diff options
author | John Resig <jeresig@gmail.com> | 2010-09-17 14:53:10 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-09-17 14:53:10 -0400 |
commit | 77e310b906112c9e20dfbf0e91249a0b81cf6107 (patch) | |
tree | d32118f13bc7060256298fb69ec35ef8fe0f7d14 /src/css.js | |
parent | 6541eb9d80db42c6ced396fcd198228bff9ec7f1 (diff) | |
download | jquery-77e310b906112c9e20dfbf0e91249a0b81cf6107.tar.gz jquery-77e310b906112c9e20dfbf0e91249a0b81cf6107.zip |
Simplifying the camelCase logic used in the CSS and Effects modules.
Diffstat (limited to 'src/css.js')
-rw-r--r-- | src/css.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/css.js b/src/css.js index 8ea815c8e..84b6e6023 100644 --- a/src/css.js +++ b/src/css.js @@ -64,7 +64,7 @@ jQuery.extend({ } // Make sure that we're working with the right name - var ret, origName = name.replace( rdashAlpha, fcamelCase ), + var ret, origName = jQuery.camelCase( name ), style = elem.style, hooks = jQuery.cssHooks[ origName ]; name = jQuery.cssProps[ origName ] || origName; @@ -94,7 +94,7 @@ jQuery.extend({ css: function( elem, name, extra ) { // Make sure that we're working with the right name - var ret, origName = name.replace( rdashAlpha, fcamelCase ), + var ret, origName = jQuery.camelCase( name ), hooks = jQuery.cssHooks[ origName ]; name = jQuery.cssProps[ origName ] || origName; @@ -125,6 +125,10 @@ jQuery.extend({ for ( name in options ) { elem.style[ name ] = old[ name ]; } + }, + + camelCase: function( string ) { + return string.replace( rdashAlpha, fcamelCase ); } }); |