node-event-delegate.js revision 880e669b7511522574aac05c8da02f079ea4bedc
YUI.add('node-event-delegate', function(Y) {
/**
* Functionality to make the node a delegated event container
* @module node
* @submodule node-event-delegate
*/
/**
* Functionality to make the node a delegated event container
* @method delegate
* @param type {String} the event type to delegate
* @param fn {Function} the function to execute
* @param selector {String} a selector that must match the target of the event.
* @return {Event.Handle} the detach handle
* @for Node
*/
Y.Node.prototype.delegate = function(type, fn, selector) {
var args = Y.Array(arguments, 0, true);
args.splice(2, 0, this._node);
return Y.delegate.apply(Y, args);
};
}, '@VERSION@' ,{requires:['node-base', 'event-delegate']});