Skip to content

Commit

Permalink
Dialog: Fixed #3032: Calling open on an already open dialog no longer…
Browse files Browse the repository at this point in the history
… causes problems.
  • Loading branch information
scottgonzalez committed Jun 26, 2008
1 parent 80e59fb commit 0f6d750
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ui/ui.dialog.js
Expand Up @@ -144,6 +144,7 @@ $.widget("ui.dialog", {
}

this.createButtons(options.buttons);
this.isOpen = false;

(options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
(options.autoOpen && this.open());
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 0f6d750

Please sign in to comment.