Skip to content

Commit

Permalink
Dialog: Don't try to place the dialog next to itself on destroy. Fixe…
Browse files Browse the repository at this point in the history
…s #8613 - Destroying a dialog removes the original element from the DOM.
  • Loading branch information
scottgonzalez committed Oct 1, 2012
1 parent 9b0c8b7 commit 4ab4684
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/jquery.ui.dialog.js
Expand Up @@ -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 );
Expand Down

0 comments on commit 4ab4684

Please sign in to comment.