diff options
author | jeresig <jeresig@gmail.com> | 2009-12-03 11:15:26 -0500 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2009-12-03 11:15:26 -0500 |
commit | c3b2aa99288a7f7c4920c4add8c1aab272bbff4b (patch) | |
tree | e9ac73d7e9523551b6fdcc016a0691585dc0ce86 | |
parent | 24e96ba22ca86e54f2442b88ffd2b7ea3f60f0bf (diff) | |
download | jquery-c3b2aa99288a7f7c4920c4add8c1aab272bbff4b.tar.gz jquery-c3b2aa99288a7f7c4920c4add8c1aab272bbff4b.zip |
Landed the rest of the liveHandler rewrite that takes advantage of the new closest multi-selector signature (sorry, accidentally committed some of it in the wrong commit: 4daae7a79f43815935a2890d16904c5a052717f3).
-rw-r--r-- | src/event.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/event.js b/src/event.js index 24e5ef11d..7b765ce8a 100644 --- a/src/event.js +++ b/src/event.js @@ -756,23 +756,20 @@ function liveHandler( event ) { for ( j in live ) { if ( live[j].live === event.type ) { selectors.push( live[j].selector ); + } else { + delete live[j]; } } - console.log( event.type, selectors+"" ); - - // TODO: Make sure that duplicate selectors aren't run match = jQuery( event.target ).closest( selectors, event.currentTarget ); - console.log( "match", match, selectors+"" ); - for ( i = 0, l = match.length; i < l; i++ ) { for ( j in live ) { fn = live[j]; elem = match[i].elem; related = null; - if ( match[i].selector === fn.selector) { + if ( match[i].selector === fn.selector ) { // Those two events require additional checking if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) { related = jQuery( event.relatedTarget ).closest( fn.selector )[0]; @@ -785,8 +782,6 @@ function liveHandler( event ) { } } - console.log( "elems", elems ); - for ( i = 0, l = elems.length; i < l; i++ ) { match = elems[i]; event.currentTarget = match.elem; |