Skip to content

Instantly share code, notes, and snippets.

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