Skip to content

Commit 0f6d750

Browse files
committed
Dialog: Fixed #3032: Calling open on an already open dialog no longer causes problems.
1 parent 80e59fb commit 0f6d750

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ui/ui.dialog.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ $.widget("ui.dialog", {
144144
}
145145

146146
this.createButtons(options.buttons);
147+
this.isOpen = false;
147148

148149
(options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
149150
(options.autoOpen && this.open());
@@ -241,6 +242,8 @@ $.widget("ui.dialog", {
241242
},
242243

243244
open: function() {
245+
if (this.isOpen) { return; }
246+
244247
this.overlay = this.options.modal ? new $.ui.dialog.overlay(this) : null;
245248
this.uiDialog.appendTo('body');
246249
this.position(this.options.position);
@@ -255,6 +258,8 @@ $.widget("ui.dialog", {
255258
};
256259
this.uiDialogTitlebarClose.focus();
257260
this.element.triggerHandler("dialogopen", [openEV, openUI], this.options.open);
261+
262+
this.isOpen = true;
258263
},
259264

260265
// the force parameter allows us to move modal dialogs to their correct
@@ -282,6 +287,8 @@ $.widget("ui.dialog", {
282287
};
283288
this.element.triggerHandler("dialogclose", [closeEV, closeUI], this.options.close);
284289
$.ui.dialog.overlay.resize();
290+
291+
this.isOpen = false;
285292
},
286293

287294
destroy: function() {

0 commit comments

Comments
 (0)