mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Cache reference to propHook lookup and result
This commit is contained in:
parent
66202aeae5
commit
7babc7f203
@ -484,8 +484,11 @@ jQuery.event = {
|
||||
|
||||
// store a copy of the original event object
|
||||
// and "clone" to set read-only properties
|
||||
var originalEvent = event;
|
||||
var originalEvent = event,
|
||||
propHook;
|
||||
|
||||
event = jQuery.Event( originalEvent );
|
||||
propHook = jQuery.event.propHooks[ event.type ];
|
||||
|
||||
for ( var i = this.props.length, prop; i; ) {
|
||||
prop = this.props[ --i ];
|
||||
@ -510,8 +513,8 @@ jQuery.event = {
|
||||
event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
|
||||
}
|
||||
|
||||
if ( jQuery.event.propHooks[ event.type ] ) {
|
||||
event = jQuery.event.propHooks[ event.type ]( event, originalEvent );
|
||||
if ( propHook ) {
|
||||
event = propHook( event, originalEvent );
|
||||
}
|
||||
|
||||
return event;
|
||||
|
Loading…
Reference in New Issue
Block a user