aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2008-06-26 18:14:41 +0000
committerScott González <scott.gonzalez@gmail.com>2008-06-26 18:14:41 +0000
commit0f6d7502ca7a84a3b0a0324327db8cebf5196749 (patch)
treede57d3c996a34bcd7e58e3faa710dc133a2cd556
parent80e59fb0b21ad4407e81f7e927be1e641dbdee06 (diff)
downloadjquery-ui-0f6d7502ca7a84a3b0a0324327db8cebf5196749.tar.gz
jquery-ui-0f6d7502ca7a84a3b0a0324327db8cebf5196749.zip
Dialog: Fixed #3032: Calling open on an already open dialog no longer causes problems.
-rw-r--r--ui/ui.dialog.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js
index 7731309a9..b989fedf9 100644
--- a/ui/ui.dialog.js
+++ b/ui/ui.dialog.js
@@ -144,6 +144,7 @@ $.widget("ui.dialog", {
}
this.createButtons(options.buttons);
+ this.isOpen = false;
(options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
(options.autoOpen && this.open());
@@ -241,6 +242,8 @@ $.widget("ui.dialog", {
},
open: function() {
+ if (this.isOpen) { return; }
+
this.overlay = this.options.modal ? new $.ui.dialog.overlay(this) : null;
this.uiDialog.appendTo('body');
this.position(this.options.position);
@@ -255,6 +258,8 @@ $.widget("ui.dialog", {
};
this.uiDialogTitlebarClose.focus();
this.element.triggerHandler("dialogopen", [openEV, openUI], this.options.open);
+
+ this.isOpen = true;
},
// the force parameter allows us to move modal dialogs to their correct
@@ -282,6 +287,8 @@ $.widget("ui.dialog", {
};
this.element.triggerHandler("dialogclose", [closeEV, closeUI], this.options.close);
$.ui.dialog.overlay.resize();
+
+ this.isOpen = false;
},
destroy: function() {