From 8f8675a26abf86ff6a77bc750096b77491d71213 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Feb 2021 14:31:36 +0300 Subject: * filters: remove duplicate code, overall cleanup * check if some tres exist before trying to reload them --- js/PrefLabelTree.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/PrefLabelTree.js') 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 }); } }, -- cgit v1.2.3-54-g00ecf