delegate.js revision 5889c2819167de6bb3c1d1a1e3a5e6af060e8a95
(function() {
var delegates = {},
_worker = function(delegateKey, e) {
e.target = v;
return true;
}
});
}
}
},
});
/**
* Sets up a delegated listener container.
* @event delegate
* @param type {string} 'delegate'
* @param fn {string} the function to execute
* @param el {string|node} the element that is the delegation container
* @param delegateType {string} the event type to delegate
* @param spec {string} a selector that must match the target of the
* event.
* @return {Event.Handle} the detach handle
* @for YUI
*/
if (!spec) {
return false;
}
// identifier to target the container
// the custom event for the delegation spec
// the key to the listener for the event type and container
a = Y.Array(arguments, 0, true);
if (!(delegateKey in delegates)) {
delegates[delegateKey] = {};
// set up the listener on the container
Y.on(delegateType, function(e) {
_worker(delegateKey, e);
}, el);
}
a[0] = ename;
// remove element, delegation spec and context object from the args
// subscribe to the custom event for the delegation spec
}
};
})();