summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-01 10:55:39 +0300
committerAndrew Dolgov <[email protected]>2018-12-01 10:56:25 +0300
commite720e6b628abcf860783fe59ea71711efc187d0e (patch)
tree581152a7de883dcbc83d5d037427a7b71aec5883
parentc151607b91ca8f9e03d756955b8a80852712e15c (diff)
remove infobox_callback2
-rwxr-xr-xjs/functions.js71
1 files changed, 33 insertions, 38 deletions
diff --git a/js/functions.js b/js/functions.js
index 25aa26d39..0622ff8e0 100755
--- a/js/functions.js
+++ b/js/functions.js
@@ -342,48 +342,43 @@ function displayDlg(title, id, param, callback) {
const query = { op: "dlg", method: id, param: param };
xhrPost("backend.php", query, (transport) => {
- infobox_callback2(transport, title);
- if (callback) callback(transport);
- });
-
- return false;
-}
-
-function infobox_callback2(transport, title) {
- let dialog = false;
-
- if (dijit.byId("infoBox")) {
- dialog = dijit.byId("infoBox");
- }
+ try {
+ const content = transport.responseText;
+
+ let dialog = dijit.byId("infoBox");
+
+ 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);
+ }
- //console.log("infobox_callback2");
- notify('');
+ dialog.show();
- const content = transport.responseText;
+ notify("");
- 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();
+ if (callback) callback(transport);
+ } catch (e) {
+ exception_error(e);
+ }
+ });
- notify("");
+ return false;
}
function getInitParam(key) {