mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Removing a stale line of code in .data()
This commit is contained in:
parent
47c605f693
commit
471290deb6
20
src/data.js
20
src/data.js
@ -158,19 +158,21 @@ jQuery.extend({
|
|||||||
|
|
||||||
if ( thisCache ) {
|
if ( thisCache ) {
|
||||||
|
|
||||||
// Support space separated names
|
// Support array or space separated string names for data keys
|
||||||
if ( jQuery.isArray( name ) ) {
|
if ( !jQuery.isArray( name ) ) {
|
||||||
name = name;
|
|
||||||
} else if ( name in thisCache ) {
|
|
||||||
name = [ name ];
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// split the camel cased version by spaces
|
// try the string as a key before any manipulation
|
||||||
name = jQuery.camelCase( name );
|
|
||||||
if ( name in thisCache ) {
|
if ( name in thisCache ) {
|
||||||
name = [ name ];
|
name = [ name ];
|
||||||
} else {
|
} else {
|
||||||
name = name.split( " " );
|
|
||||||
|
// split the camel cased version by spaces unless a key with the spaces exists
|
||||||
|
name = jQuery.camelCase( name );
|
||||||
|
if ( name in thisCache ) {
|
||||||
|
name = [ name ];
|
||||||
|
} else {
|
||||||
|
name = name.split( " " );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user