Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of soon-to-be-deprecated jQuery methods #1813

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
All: Remove uses of jQuery.camelCase()
Ref #15160
  • Loading branch information
scottgonzalez committed May 8, 2017
commit 1e44431ee3c50f0a567e8c0d7464a8014e5c61b5
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