Bug Tracker

Ticket #2378: jquery-toggle.diff

File jquery-toggle.diff, 1.0 kB (added by flesler, 10 months ago)

Here's the diff

  • src/fx.js

     
    3535     
    3636    toggle: function( fn, fn2 ){ 
    3737        return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? 
    38             this._toggle( fn, fn2 ) : 
     38            this._toggle.apply( this, arguments ) : 
    3939            fn ? 
    4040                this.animate({ 
    4141                    height: "toggle", width: "toggle", opacity: "toggle" 
  • src/event.js

     
    433433 
    434434        return this.click(function(event) { 
    435435            // Figure out which function to execute 
    436             this.lastToggle = 0 == this.lastToggle ? 1 : 0; 
     436            this.lastToggle = (this.lastToggle||0) % args.length 
    437437             
    438438            // Make sure that clicks stop 
    439439            event.preventDefault(); 
    440440             
    441441            // and execute the function 
    442             return args[this.lastToggle].apply( this, arguments ) || false; 
     442            return args[this.lastToggle++].apply( this, arguments ) || false; 
    443443        }); 
    444444    }, 
    445445