Move this.type setting to after prop set; avoid setting twice
This commit is contained in:
parent
23a411b6bc
commit
b1b2e83394
1 changed files with 4 additions and 1 deletions
|
@ -580,7 +580,6 @@ jQuery.Event = function( src ) {
|
|||
// Event object
|
||||
if ( src && src.type ) {
|
||||
this.originalEvent = src;
|
||||
this.type = src.type;
|
||||
|
||||
// Push explicitly provided properties onto the event object
|
||||
for ( var prop in src ) {
|
||||
|
@ -591,6 +590,10 @@ jQuery.Event = function( src ) {
|
|||
}
|
||||
}
|
||||
|
||||
if ( !this.type ) {
|
||||
this.type = src.type;
|
||||
}
|
||||
|
||||
// Events bubbling up the document may have been marked as prevented
|
||||
// by a handler lower down the tree; reflect the correct value.
|
||||
this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
|
||||
|
|
Loading…
Reference in a new issue