]> source.dussan.org Git - jquery.git/commitdiff
Fixed regression with 5276 where return false in first handler of multiple handlers...
authorBrandon Aaron <brandon.aaron@gmail.com>
Wed, 23 Apr 2008 18:57:17 +0000 (18:57 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Wed, 23 Apr 2008 18:57:17 +0000 (18:57 +0000)
src/event.js

index e08a085c8043d9ddb22d3ef42c22d5ec9ec3de74..25161d3fe6fb2438eb09d1d249d2ec5e997ad514 100644 (file)
@@ -231,7 +231,7 @@ jQuery.event = {
 
        handle: function(event) {
                // returned undefined or false
-               var val, namespace, all, handlers;
+               var val, ret, namespace, all, handlers;
 
                event = arguments[0] = jQuery.event.fix( event || window.event );
 
@@ -253,14 +253,17 @@ jQuery.event = {
                                event.handler = handler;
                                event.data = handler.data;
                                
-                               val = handler.apply( this, arguments );
+                               ret = handler.apply( this, arguments );
+
+                               if ( val !== false )
+                                       val = ret;
+
+                               if ( ret === false ) {
+                                       event.preventDefault();
+                                       event.stopPropagation();
+                               }
                        }
                }
-               
-               if ( val === false ) {
-                       event.preventDefault();
-                       event.stopPropagation();
-               }
 
                // Clean up added properties in IE to prevent memory leak
                if (jQuery.browser.msie)