summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-06-05 11:41:28 +0300
committerAndrew Dolgov <[email protected]>2022-06-05 11:41:28 +0300
commitfc847121352d4b0e54e046473420d35cac255a62 (patch)
treed24fdefd5fd5703c527e56318b5786322b125765 /js
parent185234bc67023640a0890daf69faeaa0df8575da (diff)
pref-filters: add a button to hide or show rules in the filter list
Diffstat (limited to 'js')
-rw-r--r--js/PrefFilterTree.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js
index fff58ff1a..d4496b647 100644
--- a/js/PrefFilterTree.js
+++ b/js/PrefFilterTree.js
@@ -4,6 +4,13 @@
define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], function (declare, domConstruct) {
return declare("fox.PrefFilterTree", lib.CheckBoxTree, {
+ postCreate: function() {
+ this.inherited(arguments);
+
+ dijit.byId('filterTree').hideOrShowFilterRules(
+ parseInt(localStorage.getItem("ttrss:hide-filter-rules"))
+ );
+ },
_createTreeNode: function(args) {
const tnode = this.inherited(arguments);
@@ -96,6 +103,16 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
Notify.close();
});
},
+ hideOrShowFilterRules(hide) {
+ App.findAll("body")[0].setAttribute("hide-filter-rules", !!hide);
+ },
+ toggleRules: function() {
+ const hide = !parseInt(localStorage.getItem("ttrss:hide-filter-rules"));
+
+ this.hideOrShowFilterRules(hide);
+
+ localStorage.setItem("ttrss:hide-filter-rules", hide ? 1 : 0);
+ },
resetFilterOrder: function() {
Notify.progress("Loading, please wait...");