Skip to content

Commit

Permalink
Event: remove preDispatch hook & simplify "simulate" signature
Browse files Browse the repository at this point in the history
Closes gh-2358
  • Loading branch information
markelog committed Jun 5, 2015
1 parent 0019a46 commit 3655c4e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();
}
Expand Down Expand Up @@ -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 ] = {
Expand Down

1 comment on commit 3655c4e

@timmywil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For anyone seeing this: despite the commit message, the preDispatch hook will not be removed.

Please sign in to comment.