diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2013-06-21 15:45:30 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2013-06-24 12:23:12 -0400 |
commit | 147726af127bce98b4e9dfe517d68f4a1ea0c1fc (patch) | |
tree | b45ab1ab8d8626cb1bab20fad131412f6f7de6a7 /src/data.js | |
parent | 3a434434c420096cef478936ea21b33e9cfae30c (diff) | |
download | jquery-147726af127bce98b4e9dfe517d68f4a1ea0c1fc.tar.gz jquery-147726af127bce98b4e9dfe517d68f4a1ea0c1fc.zip |
Fixes #14047 jQuery.data should not miss data-* w/ hyphenated property names
http://bugs.jquery.com/ticket/14047
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Diffstat (limited to 'src/data.js')
-rw-r--r-- | src/data.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/data.js b/src/data.js index 86dd4273f..96afe6f4e 100644 --- a/src/data.js +++ b/src/data.js @@ -113,6 +113,7 @@ Data.prototype = { cache : cache[ key ]; }, access: function( owner, key, value ) { + var stored; // In cases where either: // // 1. No key was specified @@ -126,7 +127,11 @@ Data.prototype = { // if ( key === undefined || ((key && typeof key === "string") && value === undefined) ) { - return this.get( owner, key ); + + stored = this.get( owner, key ); + + return stored !== undefined ? + stored : this.get( owner, jQuery.camelCase(key) ); } // [*]When the key is not a string, or both a key and value |