Simplifying the camelCase logic used in the CSS and Effects modules.

This commit is contained in:
John Resig 2010-09-17 14:53:10 -04:00
parent 6541eb9d80
commit 77e310b906
2 changed files with 8 additions and 9 deletions

9
src/effects.js vendored
View file

@ -3,7 +3,6 @@
var elemdisplay = {},
rfxtypes = /toggle|show|hide/,
rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/,
rdashAlpha = /-([a-z])/ig,
timerId,
fxAttrs = [
// height animations
@ -12,11 +11,7 @@ var elemdisplay = {},
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
// opacity animations
[ "opacity" ]
],
fcamelCase = function( all, letter ) {
return letter.toUpperCase();
};
];
jQuery.fn.extend({
show: function( speed, callback ) {
@ -125,7 +120,7 @@ jQuery.fn.extend({
self = this;
for ( p in prop ) {
var name = p.replace(rdashAlpha, fcamelCase);
var name = jQuery.camelCase( p );
if ( p !== name ) {
prop[ name ] = prop[ p ];