mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Dialog: Improve _destroy method, detaching dialog content from wrapper instead of appending to body.
This commit is contained in:
parent
41c2afd66b
commit
32a893128d
8
ui/jquery.ui.dialog.js
vendored
8
ui/jquery.ui.dialog.js
vendored
@ -123,20 +123,20 @@ $.widget("ui.dialog", {
|
|||||||
oldPosition = this.oldPosition;
|
oldPosition = this.oldPosition;
|
||||||
|
|
||||||
this._destroyOverlay();
|
this._destroyOverlay();
|
||||||
this.uiDialog.hide();
|
|
||||||
this.element
|
this.element
|
||||||
.removeUniqueId()
|
.removeUniqueId()
|
||||||
.removeClass( "ui-dialog-content ui-widget-content" )
|
.removeClass( "ui-dialog-content ui-widget-content" )
|
||||||
.hide()
|
.hide()
|
||||||
// TODO restore old position directly, instead of appending to body first
|
// without detaching first, the following becomes really slow
|
||||||
.appendTo( "body" );
|
.detach();
|
||||||
|
|
||||||
this.uiDialog.remove();
|
this.uiDialog.remove();
|
||||||
|
|
||||||
if ( this.originalTitle ) {
|
if ( this.originalTitle ) {
|
||||||
this.element.attr( "title", this.originalTitle );
|
this.element.attr( "title", this.originalTitle );
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO do this before removing the wrapper
|
|
||||||
next = oldPosition.parent.children().eq( oldPosition.index );
|
next = oldPosition.parent.children().eq( oldPosition.index );
|
||||||
// Don't try to place the dialog next to itself (#8613)
|
// Don't try to place the dialog next to itself (#8613)
|
||||||
if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
|
if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user