make sure toggleClass does not delete classNames when forcefully removing classes and they are already removed
This commit is contained in:
parent
5e6e53835e
commit
e45b41602f
2 changed files with 18 additions and 13 deletions
|
@ -141,13 +141,12 @@ jQuery.each({
|
|||
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 );
|
||||
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){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue