Skip to content
Permalink
Browse files

Dialog: Ensure all animations finish and clean up themselve when dest…

…roying dialog. Fixes #5860 - Dialog: Destroying a dialog during animated close leaves .ui-effects-wrapper in DOM.
  • Loading branch information
jzaefferer committed Nov 30, 2012
1 parent 548a6ce commit 13505e5945e5532c3d56424d50ad109c665d205f
Showing with 12 additions and 1 deletion.
  1. +2 −0 tests/unit/dialog/dialog.html
  2. +9 −0 tests/unit/dialog/dialog_options.js
  3. +1 −1 ui/jquery.ui.dialog.js
@@ -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"
]
});
@@ -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);

@@ -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();

This comment has been minimized.

Copy link
@gitMithilesh

gitMithilesh Jul 7, 2015

please add comments here.

This comment has been minimized.

Copy link
@jzaefferer

jzaefferer Jul 7, 2015

Author Member

Why?

This comment has been minimized.

Copy link
@gitMithilesh

gitMithilesh Jul 7, 2015

just to know why .stop( true, true ). is added.

This comment has been minimized.

Copy link
@jzaefferer

jzaefferer Jul 7, 2015

Author Member

Look at the commit message above, which references the underlying ticket: http://bugs.jqueryui.com/ticket/5860


if ( this.originalTitle ) {
this.element.attr( "title", this.originalTitle );

0 comments on commit 13505e5

Please sign in to comment.
You can’t perform that action at this time.