// 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 ];
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;