diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-10-01 15:34:44 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-10-01 15:34:44 -0400 |
commit | 4ab4684cfc36f8afe8782eb0501b51c420d478ae (patch) | |
tree | 6e74b601c7eb860c0505aae2c8f3c5e10d47ed23 | |
parent | 9b0c8b7041a4ebd302bd03ec9e9024e645deeaa2 (diff) | |
download | jquery-ui-4ab4684cfc36f8afe8782eb0501b51c420d478ae.tar.gz jquery-ui-4ab4684cfc36f8afe8782eb0501b51c420d478ae.zip |
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.
-rw-r--r-- | ui/jquery.ui.dialog.js | 3 |
1 files changed, 2 insertions, 1 deletions
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 ); |