aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-11-17 13:14:04 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-11-26 10:28:24 +0100
commit32a893128dcda19f570dbd8f07d82e6e8d434cdf (patch)
treea6fb048f64bdd6ba9b517bcd16378ea8847bcdb4 /ui
parent41c2afd66b253df2433d730631b53aef4d80f28c (diff)
downloadjquery-ui-32a893128dcda19f570dbd8f07d82e6e8d434cdf.tar.gz
jquery-ui-32a893128dcda19f570dbd8f07d82e6e8d434cdf.zip
Dialog: Improve _destroy method, detaching dialog content from wrapper instead of appending to body.
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.dialog.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 15e19d7cf..b998c2558 100644
--- a/ui/jquery.ui.dialog.js
+++ b/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 ] ) {