diff options
Diffstat (limited to 'src/attributes/classes.js')
-rw-r--r-- | src/attributes/classes.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/attributes/classes.js b/src/attributes/classes.js index 101138415..c6178246b 100644 --- a/src/attributes/classes.js +++ b/src/attributes/classes.js @@ -2,9 +2,9 @@ define([ "../core", "../var/rnotwhite", "../var/strundefined", - "../data/var/data_priv", + "../data/var/dataPriv", "../core/init" -], function( jQuery, rnotwhite, strundefined, data_priv ) { +], function( jQuery, rnotwhite, strundefined, dataPriv ) { var rclass = /[\t\r\n\f]/g; @@ -104,7 +104,9 @@ jQuery.fn.extend({ if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + jQuery( this ).toggleClass( + value.call(this, i, this.className, stateVal), stateVal + ); }); } @@ -129,14 +131,16 @@ jQuery.fn.extend({ } else if ( type === strundefined || type === "boolean" ) { if ( this.className ) { // store className if set - data_priv.set( this, "__className__", this.className ); + dataPriv.set( this, "__className__", this.className ); } // If the element has a class name or if we're passed `false`, // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. - this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || ""; + this.className = this.className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || ""; } }); }, @@ -146,7 +150,9 @@ jQuery.fn.extend({ i = 0, l = this.length; for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { + if ( this[i].nodeType === 1 && + (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { + return true; } } |