-/*
+/*
* jQuery Event Delegation Plugin - jquery.eventdelegation.js
* Fast flexible event handling
*
'keydown',
'keypress',
'keyup'
- ], function(i, eventName) {
+ ], function(i, eventName) {
allowed[eventName] = true;
});
-
+
$.fn.extend({
delegate: function (event, selector, f) {
return $(this).each(function () {
$(this).bind(event, function (e) {
var el = $(e.target),
result = false;
-
+
while (!$(el).is('body')) {
if ($(el).is(selector)) {
result = f.apply($(el)[0], [e]);
e.preventDefault();
return;
}
-
+
el = $(el).parent();
}
});