diff options
author | gnarf <gnarf@gnarf.net> | 2011-05-18 18:13:37 -0500 |
---|---|---|
committer | gnarf <gnarf@gnarf.net> | 2011-05-18 18:13:37 -0500 |
commit | 4fc5ea141dea716c85d07f17c4b345263b464ef3 (patch) | |
tree | 94a8e4dc7487e4ab595698ff5fdea168dd7daeaf /ui | |
parent | 4f0f407df3f1808112148a3a488c7bb76b9583db (diff) | |
download | jquery-ui-4fc5ea141dea716c85d07f17c4b345263b464ef3.tar.gz jquery-ui-4fc5ea141dea716c85d07f17c4b345263b464ef3.zip |
Unit Tests & effects.scale: Fixing bugs in effects unit tests - Particularly IE, found a bug in scale.js in the meantime. Fixes #7395 - Size based effects are breaking unit tests in IE - also leaking a global var
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.effects.core.js | 2 | ||||
-rw-r--r-- | ui/jquery.effects.scale.js | 20 |
2 files changed, 13 insertions, 9 deletions
diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js index 638119579..7650aa8f4 100644 --- a/ui/jquery.effects.core.js +++ b/ui/jquery.effects.core.js @@ -451,7 +451,7 @@ $.extend( $.effects, { setTransition: function( element, list, factor, value ) { value = value || {}; $.each( list, function(i, x){ - unit = element.cssUnit( x ); + var unit = element.cssUnit( x ); if ( unit[ 0 ] > 0 ) value[ x ] = unit[ 0 ] * factor + unit[ 1 ]; }); return value; diff --git a/ui/jquery.effects.scale.js b/ui/jquery.effects.scale.js index 843aa2241..b5c49ce7c 100644 --- a/ui/jquery.effects.scale.js +++ b/ui/jquery.effects.scale.js @@ -115,11 +115,15 @@ $.effects.effect.size = function( o ) { restore = o.restore || false, scale = o.scale || 'both', origin = o.origin, - original = { - height: el.height(), - width: el.width() - }, - baseline, factor; + original, baseline, factor; + + if ( mode === "show" ) { + el.show(); + } + original = { + height: el.height(), + width: el.width() + }; el.from = o.from || original; el.to = o.to || original; @@ -149,14 +153,14 @@ $.effects.effect.size = function( o ) { if ( scale == 'box' || scale == 'both' ) { // Vertical props scaling - if ( factor.from.y != factor.to.y ) { + if ( factor.from.y !== factor.to.y ) { props = props.concat( vProps ); el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from ); el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to ); }; // Horizontal props scaling - if ( factor.from.x != factor.to.x ) { + if ( factor.from.x !== factor.to.x ) { props = props.concat( hProps ); el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from ); el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to ); @@ -167,7 +171,7 @@ $.effects.effect.size = function( o ) { if ( scale == 'content' || scale == 'both' ) { // Vertical props scaling - if ( factor.from.y != factor.to.y ) { + if ( factor.from.y !== factor.to.y ) { props = props.concat( cProps ); el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from ); el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to ); |