]> source.dussan.org Git - jquery.git/commitdiff
Event: remove preDispatch hook & simplify "simulate" signature
authorOleg Gaidarenko <markelog@gmail.com>
Thu, 28 May 2015 21:51:22 +0000 (00:51 +0300)
committerOleg Gaidarenko <markelog@gmail.com>
Fri, 5 Jun 2015 19:14:42 +0000 (22:14 +0300)
Closes gh-2358

src/event.js

index 8722268a806f7aeb60acdf45c7213cc90f3f2d32..1e954513abf9b42940bbed8e7936427afc4b85eb 100644 (file)
@@ -602,7 +602,7 @@ jQuery.event = {
        },
 
        // Piggyback on a donor event to simulate a different one
-       simulate: function( type, elem, event, bubble ) {
+       simulate: function( type, elem, event ) {
                var e = jQuery.extend(
                        new jQuery.Event(),
                        event,
@@ -624,11 +624,8 @@ jQuery.event = {
                        }
                );
 
-               if ( bubble ) {
-                       jQuery.event.trigger( e, null, elem );
-               } else {
-                       jQuery.event.dispatch.call( elem, e );
-               }
+               jQuery.event.trigger( e, null, elem );
+
                if ( e.isDefaultPrevented() ) {
                        event.preventDefault();
                }
@@ -771,7 +768,7 @@ if ( !support.focusin ) {
 
                // Attach a single capturing handler on the document while someone wants focusin/focusout
                var handler = function( event ) {
-                       jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+                       jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
                };
 
                jQuery.event.special[ fix ] = {