aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.js
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2014-07-17 10:25:59 -0700
committerTimmy Willison <timmywillisn@gmail.com>2014-07-17 10:25:59 -0700
commitc869a1ef8a031342e817a2c063179a787ff57239 (patch)
treebf70e1683cc53d5d3793a8deb0aaafe2bd684513 /src/data.js
parent8e3a0ceafa2c7c78902d0eab07d21b793deb5366 (diff)
downloadjquery-c869a1ef8a031342e817a2c063179a787ff57239.tar.gz
jquery-c869a1ef8a031342e817a2c063179a787ff57239.zip
Build: update grunt-jscs-checker and pass with the new rules
Diffstat (limited to 'src/data.js')
-rw-r--r--src/data.js42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/data.js b/src/data.js
index f9af9ae67..4db2d6c87 100644
--- a/src/data.js
+++ b/src/data.js
@@ -2,9 +2,9 @@ define([
"./core",
"./var/rnotwhite",
"./core/access",
- "./data/var/data_priv",
- "./data/var/data_user"
-], function( jQuery, rnotwhite, access, data_priv, data_user ) {
+ "./data/var/dataPriv",
+ "./data/var/dataUser"
+], function( jQuery, rnotwhite, access, dataPriv, dataUser ) {
// Implementation Summary
//
@@ -37,10 +37,10 @@ function dataAttr( elem, key, data ) {
+data + "" === data ? +data :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
- } catch( e ) {}
+ } catch ( e ) {}
// Make sure we set the data so it isn't changed later
- data_user.set( elem, key, data );
+ dataUser.set( elem, key, data );
} else {
data = undefined;
}
@@ -50,25 +50,25 @@ function dataAttr( elem, key, data ) {
jQuery.extend({
hasData: function( elem ) {
- return data_user.hasData( elem ) || data_priv.hasData( elem );
+ return dataUser.hasData( elem ) || dataPriv.hasData( elem );
},
data: function( elem, name, data ) {
- return data_user.access( elem, name, data );
+ return dataUser.access( elem, name, data );
},
removeData: function( elem, name ) {
- data_user.remove( elem, name );
+ dataUser.remove( elem, name );
},
// TODO: Now that all calls to _data and _removeData have been replaced
- // with direct calls to data_priv methods, these can be deprecated.
+ // with direct calls to dataPriv methods, these can be deprecated.
_data: function( elem, name, data ) {
- return data_priv.access( elem, name, data );
+ return dataPriv.access( elem, name, data );
},
_removeData: function( elem, name ) {
- data_priv.remove( elem, name );
+ dataPriv.remove( elem, name );
}
});
@@ -81,9 +81,9 @@ jQuery.fn.extend({
// Gets all values
if ( key === undefined ) {
if ( this.length ) {
- data = data_user.get( elem );
+ data = dataUser.get( elem );
- if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
+ if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
i = attrs.length;
while ( i-- ) {
@@ -97,7 +97,7 @@ jQuery.fn.extend({
}
}
}
- data_priv.set( elem, "hasDataAttrs", true );
+ dataPriv.set( elem, "hasDataAttrs", true );
}
}
@@ -107,7 +107,7 @@ jQuery.fn.extend({
// Sets multiple values
if ( typeof key === "object" ) {
return this.each(function() {
- data_user.set( this, key );
+ dataUser.set( this, key );
});
}
@@ -123,14 +123,14 @@ jQuery.fn.extend({
if ( elem && value === undefined ) {
// Attempt to get data from the cache
// with the key as-is
- data = data_user.get( elem, key );
+ data = dataUser.get( elem, key );
if ( data !== undefined ) {
return data;
}
// Attempt to get data from the cache
// with the key camelized
- data = data_user.get( elem, camelKey );
+ data = dataUser.get( elem, camelKey );
if ( data !== undefined ) {
return data;
}
@@ -150,18 +150,18 @@ jQuery.fn.extend({
this.each(function() {
// First, attempt to store a copy or reference of any
// data that might've been store with a camelCased key.
- var data = data_user.get( this, camelKey );
+ var data = dataUser.get( this, camelKey );
// For HTML5 data-* attribute interop, we have to
// store property names with dashes in a camelCase form.
// This might not apply to all properties...*
- data_user.set( this, camelKey, value );
+ dataUser.set( this, camelKey, value );
// *... In the case of properties that might _actually_
// have dashes, we need to also store a copy of that
// unchanged property.
if ( key.indexOf("-") !== -1 && data !== undefined ) {
- data_user.set( this, key, value );
+ dataUser.set( this, key, value );
}
});
}, null, value, arguments.length > 1, null, true );
@@ -169,7 +169,7 @@ jQuery.fn.extend({
removeData: function( key ) {
return this.each(function() {
- data_user.remove( this, key );
+ dataUser.remove( this, key );
});
}
});