diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2011-12-08 20:01:23 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-12-08 20:01:23 -0500 |
commit | 8f5f1b2e6c0f7b8b6d66bfc06c7b169a9443c2b8 (patch) | |
tree | fd5d393097bd7ded122c65e877c5157e7b6d421d /src/effects.js | |
parent | 7f6a991313380b74d5fb18782fb6b99fd6c4a22d (diff) | |
download | jquery-8f5f1b2e6c0f7b8b6d66bfc06c7b169a9443c2b8.tar.gz jquery-8f5f1b2e6c0f7b8b6d66bfc06c7b169a9443c2b8.zip |
Fix #8498. Add cssHooks[prop].expand for use by animate().
Diffstat (limited to 'src/effects.js')
-rw-r--r-- | src/effects.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/effects.js b/src/effects.js index 5c6a20bbb..926b40b54 100644 --- a/src/effects.js +++ b/src/effects.js @@ -142,24 +142,37 @@ jQuery.fn.extend({ var opt = jQuery.extend( {}, optall ), isElement = this.nodeType === 1, hidden = isElement && jQuery(this).is(":hidden"), - name, val, p, e, + name, val, p, e, hooks, replace, parts, start, end, unit, method; // will store per property easing and be used to determine when an animation is complete opt.animatedProperties = {}; + // first pass over propertys to expand / normalize for ( p in prop ) { - - // property name normalization name = jQuery.camelCase( p ); if ( p !== name ) { prop[ name ] = prop[ p ]; delete prop[ p ]; } + + if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) { + replace = hooks.expand( prop[ name ] ); + delete prop[ name ]; + + // not quite $.extend, this wont overwrite keys already present. + // also - reusing 'p' from above because we have the correct "name" + for ( p in replace ) { + if ( ! ( p in prop ) ) { + prop[ p ] = replace[ p ]; + } + } + } + } + for ( name in prop ) { val = prop[ name ]; - // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default) if ( jQuery.isArray( val ) ) { opt.animatedProperties[ name ] = val[ 1 ]; |