aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2013-03-02 14:09:39 -0500
committerRick Waldron <waldron.rick@gmail.com>2013-03-02 14:09:39 -0500
commit91824bd2923b99b03fd1a9c4447b46fd7cc96615 (patch)
tree01d754292586ec8ea4d07b3dc3dd3bfaaeff93a5
parent9bf8b040d3ec99018904c792d3c06cb1b5b222f3 (diff)
downloadjquery-91824bd2923b99b03fd1a9c4447b46fd7cc96615.tar.gz
jquery-91824bd2923b99b03fd1a9c4447b46fd7cc96615.zip
Simplify data-* attr lookup with camelKey
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
-rw-r--r--src/data.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/data.js b/src/data.js
index 906d85f3a..63796c5ba 100644
--- a/src/data.js
+++ b/src/data.js
@@ -274,7 +274,7 @@ jQuery.fn.extend({
// Attempt to "discover" the data in
// HTML5 custom data-* attrs
- data = dataAttr( elem, key, undefined );
+ data = dataAttr( elem, camelKey, undefined );
if ( data !== undefined ) {
return data;
}
@@ -312,8 +312,7 @@ jQuery.fn.extend({
});
function dataAttr( elem, key, data ) {
- var name,
- camelKey = jQuery.camelCase( key );
+ var name;
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
@@ -334,7 +333,7 @@ function dataAttr( elem, key, data ) {
} catch( e ) {}
// Make sure we set the data so it isn't changed later
- data_user.set( elem, camelKey, data );
+ data_user.set( elem, key, data );
} else {
data = undefined;
}