Skip to content

Instantly share code, notes, and snippets.

@jleppert
Created September 14, 2010 18:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jleppert/579501 to your computer and use it in GitHub Desktop.
Save jleppert/579501 to your computer and use it in GitHub Desktop.
var jQueryBind = $.fn.bind;
$.fn.bind = function( type, data, fn ) {
// mousemove.slider hack to prevent sticky slider
// mousemove.draggable hack to prevent sticky modal
if ( !fn && data && typeof data == 'function' && type != 'mousemove.slider' && type != 'mousemove.draggable' )
{
fn = data;
data = null;
}
if ( fn )
{
var origFn = fn;
var wrappedFn = function() {
try
{
return origFn.apply( this, arguments );
}
catch ( ex )
{
trackError( ex );
// re-throw ex iff error should propogate
// throw ex;
return false;
}
};
fn = wrappedFn;
}
return jQueryBind.call( this, type, data, fn );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment