Fixed bubbling of live events (if an inner element handles an event first - and stops progatation - then the parent event doesn't encounter the event). Thanks to Irae for the patch. Fixes bug #3980.

This commit is contained in:
John Resig 2009-02-09 23:29:57 +00:00
parent 0ae78024c2
commit 9aa0c69c43
5 changed files with 43 additions and 7 deletions

View file

@ -571,9 +571,13 @@ function liveHandler( event ){
}
});
elems.sort(function(a,b) {
return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest");
});
jQuery.each(elems, function(){
if ( this.fn.call(this.elem, event, this.fn.data) === false )
stop = false;
return (stop = false);
});
return stop;