Bug Tracker

Ticket #2378: jquery-toggle.txt

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

3 lines are modificated.

Line 
1Index: src/fx.js
2===================================================================
3--- src/fx.js   (revision 5084)
4+++ src/fx.js   (working copy)
5@@ -35,7 +35,7 @@
6   
7    toggle: function( fn, fn2 ){
8        return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
9-           this._toggle( fn, fn2 ) :
10+           this._toggle.apply( this, arguments ) :
11            fn ?
12                this.animate({
13                    height: "toggle", width: "toggle", opacity: "toggle"
14Index: src/event.js
15===================================================================
16--- src/event.js    (revision 5084)
17+++ src/event.js    (working copy)
18@@ -433,13 +433,13 @@
19 
20        return this.click(function(event) {
21            // Figure out which function to execute
22-           this.lastToggle = 0 == this.lastToggle ? 1 : 0;
23+           this.lastToggle = (this.lastToggle||0) % args.length
24           
25            // Make sure that clicks stop
26            event.preventDefault();
27           
28            // and execute the function
29-           return args[this.lastToggle].apply( this, arguments ) || false;
30+           return args[this.lastToggle++].apply( this, arguments ) || false;
31        });
32    },
33