git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Making sure that you can bind multiple toggles to a single element without problems...
[jquery.git]
/
src
/
event.js
diff --git
a/src/event.js
b/src/event.js
index
7cfb535
..
e2087cc
100644
(file)
--- a/
src/event.js
+++ b/
src/event.js
@@
-693,13
+693,14
@@
jQuery.fn.extend({
return this.click( jQuery.event.proxy( fn, function( event ) {
// Figure out which function to execute
return this.click( jQuery.event.proxy( fn, function( event ) {
// Figure out which function to execute
- this.lastToggle = ( this.lastToggle || 0 ) % i;
+ var lastToggle = ( jQuery.data( this, 'lastToggle' + fn.guid ) || 0 ) % i;
+ jQuery.data( this, 'lastToggle' + fn.guid, lastToggle + 1 );
// Make sure that clicks stop
event.preventDefault();
// and execute the function
// Make sure that clicks stop
event.preventDefault();
// and execute the function
- return args[ this.lastToggle++ ].apply( this, arguments ) || false;
+ return args[ lastToggle ].apply( this, arguments ) || false;
}));
},
}));
},