Bug in rmultidash. Fixes #10194

This commit is contained in:
rwldrn
2011-09-07 10:13:22 -04:00
committed by Dave Methvin
parent 4bc691a1c3
commit 8e8fa6dc1a
2 changed files with 16 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
(function( jQuery ) {
var rbrace = /^(?:\{.*\}|\[.*\])$/,
rmultiDash = /([a-z])([A-Z])/g;
rmultiDash = /([A-Z])/g;
jQuery.extend({
cache: {},
@@ -316,7 +316,8 @@ function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
data = elem.getAttribute( name );