diff options
author | John Resig <jeresig@gmail.com> | 2009-02-09 23:29:57 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2009-02-09 23:29:57 +0000 |
commit | 9aa0c69c43bad9fce5ef7732692308afb2a38ec6 (patch) | |
tree | 8f4f5be81a2ba17d828e2fa4e1c1256a4ac10d14 /src/event.js | |
parent | 0ae78024c23dd3ef4bcea883338d975dcf843597 (diff) | |
download | jquery-9aa0c69c43bad9fce5ef7732692308afb2a38ec6.tar.gz jquery-9aa0c69c43bad9fce5ef7732692308afb2a38ec6.zip |
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.
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/event.js b/src/event.js index a621eb93e..e707015c1 100644 --- a/src/event.js +++ b/src/event.js @@ -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; |