Skip to main content

Bug Tracker

Side navigation

Ticket #3820: 3820.patch
File 3820.patch, 0.9 KB (added by iraebrasil, January 10, 2009 03:16AM UTC)

patch to make a queue before firing every liveHandler solves #3820

Index: src/event.js
===================================================================
--- src/event.js	(revision 6078)
+++ src/event.js	(working copy)
@@ -560,15 +560,23 @@
 
 function liveHandler( event ){
 	var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
-		stop = true;
+		stop = true,
+		queue = [];
 
 	jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
 		if ( !event.isImmediatePropagationStopped() && check.test(fn.type) ) {
 			var elem = jQuery(event.target).closest(fn.data)[0];
-			if ( elem && fn.call(elem, event, fn.data) === false )
-				stop = false;
+			// make a queue to fire events later to avoid bug #3820
+			if ( elem )	queue.push({
+				elem:elem,
+				fn: fn
+			});
 		}
 	});
+	jQuery.each(queue, function() {
+		if(this['fn'].call(this['elem'], event, this['fn'].data) === false )
+			stop = false;
+	});
 	return stop;
 }

Download in other formats:

Original Format