aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.dialog.js
diff options
context:
space:
mode:
authorkborchers <kris.borchers@gmail.com>2011-12-23 09:53:05 -0600
committerkborchers <kris.borchers@gmail.com>2011-12-23 09:53:05 -0600
commitbd7bd936d1e437ee1154ab6b7b1cdc70b1018363 (patch)
tree585aaf2d1e9e0e9a189bb6621e18f6c4503914e2 /ui/jquery.ui.dialog.js
parent3025c51821b3e1d2307cbc56f308de0fbd4f2dad (diff)
parentf0007ec74526979837c93be13bf181b3cf57c2ce (diff)
downloadjquery-ui-bd7bd936d1e437ee1154ab6b7b1cdc70b1018363.tar.gz
jquery-ui-bd7bd936d1e437ee1154ab6b7b1cdc70b1018363.zip
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.dialog.js')
-rw-r--r--ui/jquery.ui.dialog.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 3d7638667..1f959a837 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -77,8 +77,11 @@ $.widget("ui.dialog", {
// #5742 - .attr() might return a DOMElement
if ( typeof this.originalTitle !== "string" ) {
this.originalTitle = "";
- }
-
+ }
+ this.oldPosition = {
+ parent: this.element.parent(),
+ index: this.element.parent().children().index( this.element )
+ };
this.options.title = this.options.title || this.originalTitle;
var self = this,
options = self.options,
@@ -168,7 +171,8 @@ $.widget("ui.dialog", {
},
_destroy: function() {
- var self = this;
+ var self = this, next,
+ oldPosition = this.oldPosition;
if ( self.overlay ) {
self.overlay.destroy();
@@ -183,6 +187,13 @@ $.widget("ui.dialog", {
if ( self.originalTitle ) {
self.element.attr( "title", self.originalTitle );
}
+
+ next = oldPosition.parent.children().eq( oldPosition.index );
+ if ( next.length ) {
+ next.before( self.element );
+ } else {
+ oldPosition.parent.append( self.element );
+ }
},
widget: function() {