diff options
author | Andrew Dolgov <[email protected]> | 2021-02-12 18:38:26 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-12 18:38:26 +0300 |
commit | 03b85248e6c7fb89f86cb98c839ab86f6162b657 (patch) | |
tree | 8a43339cd5089ba6bc3fd463e1ec1752f825253b /js/PrefLabelTree.js | |
parent | 71dfc834662eb4172221b3f717b03665472f3657 (diff) |
move some dialogs to xhr loading
Diffstat (limited to 'js/PrefLabelTree.js')
-rw-r--r-- | js/PrefLabelTree.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index 65dc7ea3b..eab1a643b 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -13,10 +13,10 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f _createTreeNode: function(args) { const tnode = this.inherited(arguments); - const fg_color = this.model.store.getValue(args.item, 'fg_color'); - const bg_color = this.model.store.getValue(args.item, 'bg_color'); + //const fg_color = this.model.store.getValue(args.item, 'fg_color'); + //const bg_color = this.model.store.getValue(args.item, 'bg_color'); const type = this.model.store.getValue(args.item, 'type'); - const bare_id = this.model.store.getValue(args.item, 'bare_id'); + //const bare_id = this.model.store.getValue(args.item, 'bare_id'); if (type == 'label') { const label = dojo.doc.createElement('i'); @@ -59,9 +59,6 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f }); }, editLabel: function(id) { - const query = "backend.php?op=pref-labels&method=edit&id=" + - encodeURIComponent(id); - const dialog = new fox.SingleUseDialog({ id: "labelEditDlg", title: __("Label Editor"), @@ -114,7 +111,15 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f }); } }, - href: query + content: __("Loading, please wait...") + }); + + const tmph = dojo.connect(dialog, 'onShow', function () { + dojo.disconnect(tmph); + + xhrPost("backend.php", {op: "pref-labels", method: "edit", id: id}, (transport) => { + dialog.attr('content', transport.responseText); + }) }); dialog.show(); |