Created
September 22, 2011 23:39
-
-
Save dmethvin/1236358 to your computer and use it in GitHub Desktop.
yet another propHooks take
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var originalEvent = event, | |
propHook = jQuery.event.propHooks[ event.type ], | |
copy = props; | |
event = jQuery.Event( originalEvent ); | |
// propHook can return an array of props to copy | |
if ( propHook ) { | |
copy.concat( propHook( event, originalEvent) || [] ); | |
} | |
for ( var i = copy.length, prop; i; ) { | |
prop = this.props[ --i ]; | |
event[ prop ] = originalEvent[ prop ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment