aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.js
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2013-03-02 13:04:48 -0500
committerRick Waldron <waldron.rick@gmail.com>2013-03-02 13:04:48 -0500
commit761b96c3016e09613f356bd6070be04edec74d0f (patch)
treeea62830e720982c3249d3125d2c66c3e7e8b12a0 /src/data.js
parent8f7218198dad5dd1a93dc44087159b2c34b86292 (diff)
downloadjquery-761b96c3016e09613f356bd6070be04edec74d0f.tar.gz
jquery-761b96c3016e09613f356bd6070be04edec74d0f.zip
Fixes #13550. .data should not miss attr() set data-* with hyphenated property names. Closes gh-1189
Diffstat (limited to 'src/data.js')
-rw-r--r--src/data.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/data.js b/src/data.js
index 66fe1134d..906d85f3a 100644
--- a/src/data.js
+++ b/src/data.js
@@ -30,7 +30,7 @@ Data.prototype = {
if ( !unlock ) {
unlock = Data.uid++;
descriptor[ this.expando ] = { value: unlock };
-
+
// Secure it in a non-enumerable, non-writable property
try {
Object.defineProperties( owner, descriptor );
@@ -312,7 +312,8 @@ jQuery.fn.extend({
});
function dataAttr( elem, key, data ) {
- var name;
+ var name,
+ camelKey = jQuery.camelCase( key );
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
@@ -333,7 +334,7 @@ function dataAttr( elem, key, data ) {
} catch( e ) {}
// Make sure we set the data so it isn't changed later
- data_user.set( elem, key, data );
+ data_user.set( elem, camelKey, data );
} else {
data = undefined;
}