2 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.net/yui/license.txt
8 YUI.add('node-event-delegate', function(Y) {
11 * Functionality to make the node a delegated event container
13 * @submodule node-event-delegate
17 * Functionality to make the node a delegated event container
19 * @param type {String} the event type to delegate
20 * @param fn {Function} the function to execute
21 * @param selector {String} a selector that must match the target of the event.
22 * @return {Event.Handle} the detach handle
25 Y.Node.prototype.delegate = function(type, fn, selector) {
27 var args = Array.prototype.slice.call(arguments, 3),
28 a = [type, fn, Y.Node.getDOMNode(this), selector];
31 return Y.delegate.apply(Y, a);
35 }, '3.0.0' ,{requires:['node-base', 'event-delegate', 'pluginhost']});