git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make sure toggleClass does not delete classNames when forcefully removing classes...
[jquery.git]
/
src
/
attributes.js
diff --git
a/src/attributes.js
b/src/attributes.js
index
04562ff
..
f3e1b4c
100644
(file)
--- a/
src/attributes.js
+++ b/
src/attributes.js
@@
-141,13
+141,12
@@
jQuery.each({
jQuery.className[ state ? "add" : "remove" ]( this, className );
}
} else if ( type === "undefined" || type === "boolean" ) {
jQuery.className[ state ? "add" : "remove" ]( this, className );
}
} else if ( type === "undefined" || type === "boolean" ) {
- // toggle whole className
- if ( this.className || classNames === false ) {
+ if ( this.className ) {
+ // store className if set
jQuery.data( this, "__className__", this.className );
jQuery.data( this, "__className__", this.className );
- this.className = "";
- } else {
- this.className = jQuery.data( this, "__className__" ) || "";
}
}
+ // toggle whole className
+ this.className = this.className || classNames === false ? "" : jQuery.data( this, "__className__" ) || "";
}
}
}, function(name, fn){
}
}
}, function(name, fn){