mirror of
https://github.com/jquery/jquery.git
synced 2026-02-03 01:55:04 -05:00
Fixes #13550. .data should not miss attr() set data-* with hyphenated property names. Closes gh-1189
This commit is contained in:
committed by
Rick Waldron
parent
8f7218198d
commit
761b96c301
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user