Skip to content

Instantly share code, notes, and snippets.

@mikesherov
Created April 9, 2013 18:27
Show Gist options
  • Save mikesherov/5348106 to your computer and use it in GitHub Desktop.
Save mikesherov/5348106 to your computer and use it in GitHub Desktop.
onFocus: function( element, onFocus ) {
element.bind( "focus", function( event ){
if( !event.originalEvent ) {
return;
}
element.unbind( "focus" );
onFocus();
})[ 0 ].focus();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment