]> source.dussan.org Git - jquery.git/commitdiff
Fix #12846. Restore overflow when animation is stopped.
authorDave Methvin <dave.methvin@gmail.com>
Sun, 27 Jan 2013 03:02:15 +0000 (22:02 -0500)
committerDave Methvin <dave.methvin@gmail.com>
Sun, 27 Jan 2013 03:05:08 +0000 (22:05 -0500)
(Cherry picked from a6c358d)

src/effects.js
test/unit/effects.js

index 189f65ce599e942c03baa6405b07de4751480f98..ce7017ef16df00baccba09b67591d8cc548bf2ef 100644 (file)
@@ -303,7 +303,7 @@ function defaultPrefilter( elem, props, opts ) {
        if ( opts.overflow ) {
                style.overflow = "hidden";
                if ( !jQuery.support.shrinkWrapBlocks ) {
-                       anim.done(function() {
+                       anim.always(function() {
                                style.overflow = opts.overflow[ 0 ];
                                style.overflowX = opts.overflow[ 1 ];
                                style.overflowY = opts.overflow[ 2 ];
index aa061058bfb98ff7a367dbae769c6d00d58c6680..173af5a0e2a81b11d37a572c2a4e3e0ba14b37cc 100644 (file)
@@ -1787,16 +1787,18 @@ asyncTest("Animation callbacks (#11797)", 15, function() {
        });
 });
 
-test( "Animate properly sets overflow hidden when animating width/height (#12117)", 4, function() {
+test( "Animate properly sets overflow hidden when animating width/height (#12117)", 8, function() {
        jQuery.each( [ "height", "width" ], function( _, prop ) {
                jQuery.each( [ 100, 0 ], function( _, value ) {
-                       var div = jQuery("<div>"),
+                       var div = jQuery("<div>").css( "overflow", "auto" ),
                                props = {};
                        props[ prop ] = value;
                        div.animate( props, 1 );
                        equal( div.css( "overflow" ), "hidden",
                                "overflow: hidden set when animating " + prop + " to " + value );
                        div.stop();
+                       equal( div.css( "overflow" ), "auto",
+                               "overflow: auto restored after animating " + prop + " to " + value );
                });
        });
 });