Skip to content

Instantly share code, notes, and snippets.

@dmethvin
Created September 22, 2011 23:39
Show Gist options
  • Save dmethvin/1236358 to your computer and use it in GitHub Desktop.
Save dmethvin/1236358 to your computer and use it in GitHub Desktop.
yet another propHooks take
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