All: Remove uses of jQuery.camelCase()

Ref #15160
Ref gh-1813
This commit is contained in:
Scott González 2017-05-08 10:47:27 -04:00
parent ae31f2b3b4
commit 0940cb9bd2
2 changed files with 14 additions and 2 deletions

View File

@ -59,6 +59,12 @@ domEqual.attributes = [
"title" "title"
]; ];
function camelCase( string ) {
return string.replace( /-([\da-z])/gi, function( all, letter ) {
return letter.toUpperCase();
} );
}
function getElementStyles( elem ) { function getElementStyles( elem ) {
var styles = {}; var styles = {};
var style = elem.ownerDocument.defaultView ? var style = elem.ownerDocument.defaultView ?
@ -71,7 +77,7 @@ function getElementStyles( elem ) {
while ( len-- ) { while ( len-- ) {
key = style[ len ]; key = style[ len ];
if ( typeof style[ key ] === "string" ) { if ( typeof style[ key ] === "string" ) {
styles[ $.camelCase( key ) ] = style[ key ]; styles[ camelCase( key ) ] = style[ key ];
} }
} }

View File

@ -746,6 +746,12 @@ $.each(
} }
); );
function camelCase( string ) {
return string.replace( /-([\da-z])/gi, function( all, letter ) {
return letter.toUpperCase();
} );
}
function getElementStyles( elem ) { function getElementStyles( elem ) {
var key, len, var key, len,
style = elem.ownerDocument.defaultView ? style = elem.ownerDocument.defaultView ?
@ -758,7 +764,7 @@ function getElementStyles( elem ) {
while ( len-- ) { while ( len-- ) {
key = style[ len ]; key = style[ len ];
if ( typeof style[ key ] === "string" ) { if ( typeof style[ key ] === "string" ) {
styles[ $.camelCase( key ) ] = style[ key ]; styles[ camelCase( key ) ] = style[ key ];
} }
} }