// We're overriding the old toggle function, so
// remember it for later
- //_toggle: jQuery.fn.toggle,
+ _toggle: jQuery.fn.toggle,
/**
* Toggle between two function calls every other click.
toggle: function(a,b) {
// If two functions are passed in, we're
// toggling on a click
- return a && b ? this.click(function(e){
+ return a && b && a.constructor == Function && b.constructor == Function ? this.click(function(e){
// Figure out which function to execute
this.last = this.last == a ? b : a;
}) :
// Otherwise, execute the old toggle function
- this._toggle();
+ this._toggle.apply( this, arguments );
},
/**
jQuery.ready();
}
}, 10);
- } else {
- // A fallback to window.onload, that will always work
- jQuery.event.add( window, "load", jQuery.ready );
- }
+ }
+
+ // A fallback to window.onload, that will always work
+ jQuery.event.add( window, "load", jQuery.ready );
};