X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fattributes.js;h=f3e1b4cb3fb187fdeac44b247822d91a5af9ac79;hb=e45b41602ff483ebed67b5b73008aff5ceb1fe6f;hp=04562ff8b0711100f555a33422d3d75ef10db13a;hpb=5e6e53835e552920db4f88ac0c9eca71aaacbef0;p=jquery.git diff --git a/src/attributes.js b/src/attributes.js index 04562ff..f3e1b4c 100644 --- 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" ) { - // 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){