diff options
author | Andrew Dolgov <[email protected]> | 2021-02-24 21:56:52 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-24 21:56:52 +0300 |
commit | 93940d2a9f80d9e1dac49b5eb7db23230d31c5f6 (patch) | |
tree | 71016661f6017918d0934eb462bd9552018d557a /js/PrefFilterTree.js | |
parent | 8b022c2bfb356d7dddaf334bc931d6dec77086fb (diff) | |
parent | 1adacd057230aea4ede29dab510385bf01cf99a3 (diff) |
Merge branch 'master' of git.fakecake.org:fox/tt-rss into weblate-integration
Diffstat (limited to 'js/PrefFilterTree.js')
-rw-r--r-- | js/PrefFilterTree.js | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index abfdbb3b0..fff58ff1a 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -1,5 +1,5 @@ /* eslint-disable prefer-rest-params */ -/* global __, define, lib, dijit, dojo, xhrPost, Notify */ +/* global __, define, lib, dijit, dojo, xhr, App, Notify */ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], function (declare, domConstruct) { @@ -80,26 +80,26 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio const items = tree.model.getCheckedItems(); const rv = []; - items.each(function (item) { + items.forEach(function (item) { rv.push(tree.model.store.getValue(item, 'bare_id')); }); return rv; }, reload: function() { - const user_search = $("filter_search"); + const user_search = App.byId("filter_search"); let search = ""; if (user_search) { search = user_search.value; } - xhrPost("backend.php", { op: "pref-filters", search: search }, (transport) => { - dijit.byId('filtersTab').attr('content', transport.responseText); + xhr.post("backend.php", { op: "pref-filters", search: search }, (reply) => { + dijit.byId('filtersTab').attr('content', reply); Notify.close(); }); }, resetFilterOrder: function() { Notify.progress("Loading, please wait..."); - xhrPost("backend.php", {op: "pref-filters", method: "filtersortreset"}, () => { + xhr.post("backend.php", {op: "pref-filters", method: "filtersortreset"}, () => { this.reload(); }); }, @@ -114,28 +114,11 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio if (confirm(__("Combine selected filters?"))) { Notify.progress("Joining filters..."); - xhrPost("backend.php", {op: "pref-filters", method: "join", ids: rows.toString()}, () => { + xhr.post("backend.php", {op: "pref-filters", method: "join", ids: rows.toString()}, () => { this.reload(); }); } }, - editSelectedFilter: function() { - const rows = this.getSelectedFilters(); - - if (rows.length == 0) { - alert(__("No filters selected.")); - return; - } - - if (rows.length > 1) { - alert(__("Please select only one filter.")); - return; - } - - Notify.close(); - - this.editFilter(rows[0]); - }, removeSelectedFilters: function() { const sel_rows = this.getSelectedFilters(); @@ -148,7 +131,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio ids: sel_rows.toString() }; - xhrPost("backend.php", query, () => { + xhr.post("backend.php", query, () => { this.reload(); }); } |