X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fevent%2Fevent.js;h=d63b3a09abc40bb02c990f495812b40e35e12b86;hb=48ec10044f011ccfe9bd232d629682b59cccbd97;hp=34d530a6c19717f8d7539551273a0ecedc0fbec6;hpb=7448c61ee2199f6f7002e33e533cebc42b000c89;p=jquery.git diff --git a/src/event/event.js b/src/event/event.js index 34d530a..d63b3a0 100644 --- a/src/event/event.js +++ b/src/event/event.js @@ -2,7 +2,7 @@ jQuery.fn.extend({ // 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. @@ -25,7 +25,7 @@ jQuery.fn.extend({ 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; @@ -37,7 +37,7 @@ jQuery.fn.extend({ }) : // Otherwise, execute the old toggle function - this._toggle(); + this._toggle.apply( this, arguments ); }, /**