public this repo is viewable by everyone
Description: A jQuery plugin version of the Low Pro behavior framework.
Homepage: http://lowprojs.org
Clone URL: git://github.com/danwrong/low-pro-for-jquery.git
updated so $.delegate will work if the source element is a child of the 
watched element
and that the first argument passed to the callback is the watched element, 
not the source element
danwrong (author)
about 1 month ago
commit  4d43eae57a6c5721a23769ef0738d95c8f20e6d1
tree    ac7f3f71072774012061756fd103f7c1292a2281
parent  c1dc9b8f95f0bd40fecaa048331cac9e7d5c45c9
...
80
81
82
83
84
 
 
 
 
85
86
87
...
80
81
82
 
 
83
84
85
86
87
88
89
0
@@ -80,8 +80,10 @@
0
     delegate: function(rules) {
0
       return function(e) {
0
         var target = $(e.target);
0
- for (var selector in rules)
0
- if (target.is(selector)) return rules[selector].apply(this, $.makeArray(arguments));
0
+ for (var selector in rules) {
0
+ if (target.is(selector) || ((target = target.parents(selector)) && target.length > 0))
0
+ return rules[selector].apply(this, [target].concat($.makeArray(arguments)));
0
+ }
0
       }
0
     }
0
   });

Comments

    No one has commented yet.