Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Landing pull request 512. 1.7 - removeData now takes space separated …
…lists and arrays of keys - Fixes #7323. More Details: - #512 - http://bugs.jquery.com/ticket/7323
- Loading branch information
Showing
3 changed files
with
50 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -133,7 +133,7 @@ jQuery.extend({ | ||
return; | ||
} | ||
|
||
var thisCache, | ||
var thisCache, i, l, | ||
|
||
// Reference to internal data cache key | ||
internalKey = jQuery.expando, | ||
@@ -158,12 +158,25 @@ jQuery.extend({ | ||
|
||
if ( thisCache ) { | ||
|
||
// Support interoperable removal of hyphenated or camelcased keys | ||
if ( !thisCache[ name ] ) { | ||
// Support space separated names | ||
if ( jQuery.isArray( name ) ) { | ||
name = name; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rwaldron
Member
|
||
} else if ( name in thisCache ) { | ||
name = [ name ]; | ||
} else { | ||
|
||
// split the camel cased version by spaces | ||
name = jQuery.camelCase( name ); | ||
if ( name in thisCache ) { | ||
name = [ name ]; | ||
} else { | ||
name = name.split( " " ); | ||
} | ||
} | ||
|
||
delete thisCache[ name ]; | ||
for ( i = 0, l = name.length; i < l; i++ ) { | ||
delete thisCache[ name[i] ]; | ||
} | ||
|
||
// If there is no data left in the cache, we want to continue | ||
// and let the cache object itself get destroyed | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm not that good at Javascript but I'm wondering if this is really useful ?