Dialog: Don't try to place the dialog next to itself on destroy. Fixes #8613 - Destroying a dialog removes the original element from the DOM.

This commit is contained in:
Scott González 2012-10-01 15:34:44 -04:00
parent 9b0c8b7041
commit 4ab4684cfc

View File

@ -216,7 +216,8 @@ $.widget("ui.dialog", {
} }
next = oldPosition.parent.children().eq( oldPosition.index ); next = oldPosition.parent.children().eq( oldPosition.index );
if ( next.length ) { // Don't try to place the dialog next to itself (#8613)
if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
next.before( this.element ); next.before( this.element );
} else { } else {
oldPosition.parent.append( this.element ); oldPosition.parent.append( this.element );