diff options
author | Andrew Dolgov <[email protected]> | 2022-06-06 09:31:37 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-06-06 09:31:37 +0300 |
commit | 8ef816d8f8ee964d5ce54e28e1f2686caf9176fd (patch) | |
tree | c5eda418f850ffe005ab1d551a6fa40be8c47a68 /js/PrefFeedTree.js | |
parent | 6436dd16f94415dc120e2d563c0f480f1f002183 (diff) |
feeds-tree: move external onClick dojo/method to PrefFeedTree class
Diffstat (limited to 'js/PrefFeedTree.js')
-rw-r--r-- | js/PrefFeedTree.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js index 0585173c9..85b262b6d 100644 --- a/js/PrefFeedTree.js +++ b/js/PrefFeedTree.js @@ -1,5 +1,5 @@ /* eslint-disable prefer-rest-params */ -/* global __, lib, dijit, define, dojo, CommonDialogs, Notify, Tables, xhrPost, xhr, fox, App */ +/* global __, lib, dijit, define, dojo, CommonDialogs, Notify, Tables, xhr, fox, App */ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_base/array", "dojo/cookie"], function (declare, domConstruct, checkBoxTree, array, cookie) { @@ -14,6 +14,17 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b this.checkInactiveFeeds(); this.checkErrorFeeds(); }); + + dojo.connect(this, 'onClick', (item) => { + const id = String(item.id); + const bare_id = id.substr(id.indexOf(':')+1); + + if (id.match('FEED:')) { + CommonDialogs.editFeed(bare_id); + } else if (id.match('CAT:')) { + dijit.byId('feedTree').editCategory(bare_id, item); + } + }); }, // save state in localStorage instead of cookies // reference: https://stackoverflow.com/a/27968996 |