summaryrefslogtreecommitdiff
path: root/js/PrefLabelTree.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-12 14:31:36 +0300
committerAndrew Dolgov <[email protected]>2021-02-12 14:31:36 +0300
commit8f8675a26abf86ff6a77bc750096b77491d71213 (patch)
treeb6eb5ee57a46ecd1a5caa70bbf93caabbcc721cd /js/PrefLabelTree.js
parent699186f430bb28059d7ade7a15259f1ec10ff8f3 (diff)
* filters: remove duplicate code, overall cleanup
* check if some tres exist before trying to reload them
Diffstat (limited to 'js/PrefLabelTree.js')
-rw-r--r--js/PrefLabelTree.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js
index 624b197b4..857adfb24 100644
--- a/js/PrefLabelTree.js
+++ b/js/PrefLabelTree.js
@@ -96,7 +96,8 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
};
xhrPost("backend.php", query, () => {
- dijit.byId("filterTree").reload(); // maybe there's labels in there
+ const tree = dijit.byId("filterTree");
+ if (tree) tree.reload(); // maybe there's labels in there
});
},
@@ -111,7 +112,8 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
this.hide();
xhrPost("backend.php", this.attr('value'), () => {
- dijit.byId("filterTree").reload(); // maybe there's labels in there
+ const tree = dijit.byId("filterTree");
+ if (tree) tree.reload(); // maybe there's labels in there
});
}
},