Permalink
Browse files

Data: shave off a couple of bytes

Closes gh-1931
  • Loading branch information...
FarSeeing authored and markelog committed Dec 15, 2014
1 parent 72c4a06 commit 6f65f5faf2b5831414d4c93d271a59265b41a75b
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/data.js
View
@@ -1,10 +1,9 @@
define([
"./core",
"./var/rnotwhite",
"./core/access",
"./data/var/dataPriv",
"./data/var/dataUser"
], function( jQuery, rnotwhite, access, dataPriv, dataUser ) {
], function( jQuery, access, dataPriv, dataUser ) {
// Implementation Summary
//
@@ -17,15 +16,15 @@ define([
// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
rmultiDash = /([A-Z])/g;
rmultiDash = /[A-Z]/g;
function dataAttr( elem, key, data ) {
var name;
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {

0 comments on commit 6f65f5f

Please sign in to comment.