|
@@ -15,6 +15,12 @@ let notificationsEnabled = true;
|
15
|
15
|
*/
|
16
|
16
|
let popupEnabled = true;
|
17
|
17
|
|
|
18
|
+/**
|
|
19
|
+ * Currently displayed two button dialog.
|
|
20
|
+ * @type {null}
|
|
21
|
+ */
|
|
22
|
+let twoButtonDialog = null;
|
|
23
|
+
|
18
|
24
|
var messageHandler = {
|
19
|
25
|
OK: "dialog.OK",
|
20
|
26
|
CANCEL: "dialog.Cancel",
|
|
@@ -68,7 +74,7 @@ var messageHandler = {
|
68
|
74
|
persistent, leftButtonKey, submitFunction, loadedFunction,
|
69
|
75
|
closeFunction, focus, defaultButton) {
|
70
|
76
|
|
71
|
|
- if (!popupEnabled)
|
|
77
|
+ if (!popupEnabled || twoButtonDialog)
|
72
|
78
|
return;
|
73
|
79
|
|
74
|
80
|
var buttons = [];
|
|
@@ -87,15 +93,23 @@ var messageHandler = {
|
87
|
93
|
if (msgKey) {
|
88
|
94
|
message = APP.translation.generateTranslationHTML(msgKey);
|
89
|
95
|
}
|
90
|
|
- $.prompt(message, {
|
|
96
|
+ twoButtonDialog = $.prompt(message, {
|
91
|
97
|
title: title,
|
92
|
98
|
persistent: false,
|
93
|
99
|
buttons: buttons,
|
94
|
100
|
defaultButton: defaultButton,
|
95
|
101
|
focus: focus,
|
96
|
102
|
loaded: loadedFunction,
|
97
|
|
- submit: submitFunction,
|
98
|
|
- close: closeFunction
|
|
103
|
+ submit: function (e, v, m, f) {
|
|
104
|
+ twoButtonDialog = null;
|
|
105
|
+ if (submitFunction)
|
|
106
|
+ submitFunction(e, v, m, f);
|
|
107
|
+ },
|
|
108
|
+ close: function () {
|
|
109
|
+ twoButtonDialog = null;
|
|
110
|
+ if (closeFunction)
|
|
111
|
+ closeFunction();
|
|
112
|
+ }
|
99
|
113
|
});
|
100
|
114
|
},
|
101
|
115
|
|
|
@@ -133,7 +147,7 @@ var messageHandler = {
|
133
|
147
|
if (persistent) {
|
134
|
148
|
args.closeText = '';
|
135
|
149
|
}
|
136
|
|
-
|
|
150
|
+
|
137
|
151
|
return new Impromptu(msgString, args);
|
138
|
152
|
},
|
139
|
153
|
|