From: Scott González Date: Mon, 1 Oct 2012 19:34:44 +0000 (-0400) Subject: Dialog: Don't try to place the dialog next to itself on destroy. Fixes #8613 - Destro... X-Git-Tag: 1.9.0~14 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4ab4684cfc36f8afe8782eb0501b51c420d478ae;p=jquery-ui.git 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. --- diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index bcbb68c5a..77424047c 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -216,7 +216,8 @@ $.widget("ui.dialog", { } 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 ); } else { oldPosition.parent.append( this.element );