From 9aa0c69c43bad9fce5ef7732692308afb2a38ec6 Mon Sep 17 00:00:00 2001 From: John Resig Date: Mon, 9 Feb 2009 23:29:57 +0000 Subject: 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. --- src/event.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/event.js') 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; -- cgit v1.2.3