Skip to content

Commit

Permalink
All: Remove uses of jQuery.camelCase()
Browse files Browse the repository at this point in the history
Ref #15160
Ref gh-1813
  • Loading branch information
scottgonzalez committed May 17, 2017
1 parent ae31f2b commit 0940cb9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion tests/lib/qunit-assert-domequal.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ domEqual.attributes = [
"title"
];

function camelCase( string ) {
return string.replace( /-([\da-z])/gi, function( all, letter ) {
return letter.toUpperCase();
} );
}

function getElementStyles( elem ) {
var styles = {};
var style = elem.ownerDocument.defaultView ?
Expand All @@ -71,7 +77,7 @@ function getElementStyles( elem ) {
while ( len-- ) {
key = style[ len ];
if ( typeof style[ key ] === "string" ) {
styles[ $.camelCase( key ) ] = style[ key ];
styles[ camelCase( key ) ] = style[ key ];
}
}

Expand Down
8 changes: 7 additions & 1 deletion ui/effect.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,12 @@ $.each(
}
);

function camelCase( string ) {
return string.replace( /-([\da-z])/gi, function( all, letter ) {
return letter.toUpperCase();
} );
}

function getElementStyles( elem ) {
var key, len,
style = elem.ownerDocument.defaultView ?
Expand All @@ -758,7 +764,7 @@ function getElementStyles( elem ) {
while ( len-- ) {
key = style[ len ];
if ( typeof style[ key ] === "string" ) {
styles[ $.camelCase( key ) ] = style[ key ];
styles[ camelCase( key ) ] = style[ key ];
}
}

Expand Down

0 comments on commit 0940cb9

Please sign in to comment.