mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Move this.type setting to after prop set; avoid setting twice
This commit is contained in:
parent
23a411b6bc
commit
b1b2e83394
@ -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 New Issue
Block a user