summaryrefslogtreecommitdiff
path: root/functions.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-17 10:12:50 +0300
committerAndrew Dolgov <[email protected]>2010-11-17 10:12:50 +0300
commit439caa8b93b8d0f38e0c565367511695e4b5c6f8 (patch)
tree3a232b2e0c666e48b9a3af659085a4783e9adbdf /functions.js
parent76657c46b87b66fe2bdd1fd9cf56a84016530811 (diff)
dialog behaviour fixes
Diffstat (limited to 'functions.js')
-rw-r--r--functions.js49
1 files changed, 24 insertions, 25 deletions
diff --git a/functions.js b/functions.js
index a040ae65d..96c5fce2a 100644
--- a/functions.js
+++ b/functions.js
@@ -2,7 +2,6 @@ var hotkeys_enabled = true;
var notify_silent = false;
var last_progress_point = 0;
var sanity_check_done = false;
-var dialogs = [];
/* add method to remove element from array */
@@ -392,10 +391,9 @@ function closeInfoBox(cleanup) {
try {
enableHotkeys();
- var dialog = dialogs.pop();
+ dialog = dijit.byId("infoBox");
- if (dialog)
- dialog.hide();
+ if (dialog) dialog.hide();
} catch (e) {
//exception_error("closeInfoBox", e);
@@ -438,9 +436,10 @@ function infobox_submit_callback2(transport) {
function infobox_callback2(transport) {
try {
+ var dialog = false;
+
if (dijit.byId("infoBox")) {
- dialogs.pop();
- dijit.byId("infoBox").destroy();
+ dialog = dijit.byId("infoBox");
}
//console.log("infobox_callback2");
@@ -464,28 +463,28 @@ function infobox_callback2(transport) {
content = transport.responseText;
}
- var dialog = new dijit.Dialog({
- title: title,
- id: 'infoBox',
- style: "width: 600px",
- onCancel: function() {
- dialogs.remove(this);
- return true;
- },
- onExecute: function() {
- dialogs.remove(this);
- return true;
- },
- onClose: function() {
- dialogs.remove(this);
- return true;
- },
- content: content});
+ if (!dialog) {
+ dialog = new dijit.Dialog({
+ title: title,
+ id: 'infoBox',
+ style: "width: 600px",
+ onCancel: function() {
+ return true;
+ },
+ onExecute: function() {
+ return true;
+ },
+ onClose: function() {
+ return true;
+ },
+ content: content});
+ } else {
+ dialog.attr('title', title);
+ dialog.attr('content', content);
+ }
dialog.show();
- dialogs.push(dialog);
-
notify("");
} catch (e) {
exception_error("infobox_callback2", e);