Use explicit "new jQuery.Event" to avoid double-function-call overhead.
This commit is contained in:
parent
7fa6de0ec1
commit
352715bd08
1 changed files with 3 additions and 3 deletions
|
@ -314,9 +314,9 @@ jQuery.event = {
|
|||
// jQuery.Event object
|
||||
event[ jQuery.expando ] ? event :
|
||||
// Object literal
|
||||
jQuery.extend( jQuery.Event(type), event ) :
|
||||
jQuery.extend( new jQuery.Event(type), event ) :
|
||||
// Just the event type (string)
|
||||
jQuery.Event(type);
|
||||
new jQuery.Event(type);
|
||||
event.namespace = namespaces.join(".");
|
||||
event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
|
||||
event.exclusive = exclusive;
|
||||
|
@ -989,7 +989,7 @@ jQuery.fn.extend({
|
|||
|
||||
triggerHandler: function( type, data ) {
|
||||
if ( this[0] ) {
|
||||
var event = jQuery.Event( type );
|
||||
var event = new jQuery.Event( type );
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
jQuery.event.trigger( event, data, this[0] );
|
||||
|
|
Loading…
Reference in a new issue