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: 4daae7a79f).

This commit is contained in:
jeresig 2009-12-03 11:15:26 -05:00
parent 24e96ba22c
commit c3b2aa9928

View file

@ -756,16 +756,13 @@ function liveHandler( event ) {
for ( j in live ) { for ( j in live ) {
if ( live[j].live === event.type ) { if ( live[j].live === event.type ) {
selectors.push( live[j].selector ); 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 ); match = jQuery( event.target ).closest( selectors, event.currentTarget );
console.log( "match", match, selectors+"" );
for ( i = 0, l = match.length; i < l; i++ ) { for ( i = 0, l = match.length; i < l; i++ ) {
for ( j in live ) { for ( j in live ) {
fn = live[j]; fn = live[j];
@ -785,8 +782,6 @@ function liveHandler( event ) {
} }
} }
console.log( "elems", elems );
for ( i = 0, l = elems.length; i < l; i++ ) { for ( i = 0, l = elems.length; i < l; i++ ) {
match = elems[i]; match = elems[i];
event.currentTarget = match.elem; event.currentTarget = match.elem;