]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Ensure all animations finish and clean up themselve when destroying dialog...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 30 Nov 2012 12:08:56 +0000 (13:08 +0100)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 30 Nov 2012 12:08:56 +0000 (13:08 +0100)
tests/unit/dialog/dialog.html
tests/unit/dialog/dialog_options.js
ui/jquery.ui.dialog.js

index 5413e7cc1bfe6baf32b84b3f162f8c85b89b74a5..cdc8464784a25f6bf1897b807c530c80e8e91c29 100644 (file)
@@ -23,6 +23,8 @@
                        "ui/jquery.ui.draggable.js",
                        "ui/jquery.ui.resizable.js",
                        "ui/jquery.ui.button.js",
+                       "ui/jquery.ui.effect.js",
+                       "ui/jquery.ui.effect-clip.js",
                        "ui/jquery.ui.dialog.js"
                ]
        });
index f01a1a2a89601d3173b3b986b1bc010a91f16e7c..fd7d918275e67654eb186d254c0d947b472def42 100644 (file)
@@ -212,6 +212,15 @@ test("height", function() {
        el.remove();
 });
 
+asyncTest( "hide, #5860 - don't leave effects wrapper behind", function() {
+       expect( 1 );
+       $( "#dialog1" ).dialog({ hide: "clip" }).dialog( "close" ).dialog( "destroy" );
+       setTimeout(function() {
+               equal( $( ".ui-effects-wrapper" ).length, 0 );
+               start();
+       }, 500);
+});
+
 test("maxHeight", function() {
        expect(3);
 
index 46fc7adf485f3d457713a8d0d9019087cc9c7a12..4a8b9964f46275786a653edaa776ac1c20525898 100644 (file)
@@ -131,7 +131,7 @@ $.widget("ui.dialog", {
                        // without detaching first, the following becomes really slow
                        .detach();
 
-               this.uiDialog.remove();
+               this.uiDialog.stop( true, true ).remove();
 
                if ( this.originalTitle ) {
                        this.element.attr( "title", this.originalTitle );