]> source.dussan.org Git - jquery-ui.git/commitdiff
All: Remove uses of `jQuery.camelCase()`
authorScott González <scott.gonzalez@gmail.com>
Mon, 8 May 2017 14:47:27 +0000 (10:47 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 17 May 2017 15:17:09 +0000 (11:17 -0400)
Ref #15160
Ref gh-1813

tests/lib/qunit-assert-domequal.js
ui/effect.js

index b22bd90b969d69540912e4b19479d40bd7aa0148..35695c4f1c0016a820101a857f420687165e2b10 100644 (file)
@@ -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 ?
@@ -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 ];
                        }
                }
 
index 31e6024a174c2dbaeac0153fc74ca066b2522e11..2d17affd1f4e7fd2bac14506bdd3b8ea981d4a8d 100644 (file)
@@ -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 ?
@@ -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 ];
                        }
                }