Skip to content
Permalink
Browse files

Dialog: Improve _destroy method, detaching dialog content from wrappe…

…r instead of appending to body.
  • Loading branch information...
jzaefferer committed Nov 17, 2012
1 parent 41c2afd commit 32a893128dcda19f570dbd8f07d82e6e8d434cdf
Showing with 4 additions and 4 deletions.
  1. +4 −4 ui/jquery.ui.dialog.js
@@ -123,20 +123,20 @@ $.widget("ui.dialog", {
oldPosition = this.oldPosition;

this._destroyOverlay();
this.uiDialog.hide();

this.element
.removeUniqueId()
.removeClass( "ui-dialog-content ui-widget-content" )
.hide()
// TODO restore old position directly, instead of appending to body first
.appendTo( "body" );
// without detaching first, the following becomes really slow
.detach();

this.uiDialog.remove();

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

// TODO do this before removing the wrapper
next = oldPosition.parent.children().eq( oldPosition.index );
// Don't try to place the dialog next to itself (#8613)
if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {

0 comments on commit 32a8931

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