diff options
| author | wn_ <invalid@email.com> | 2025-01-06 00:25:56 +0000 |
|---|---|---|
| committer | wn_ <invalid@email.com> | 2025-01-06 00:33:18 +0000 |
| commit | 91496a0d24d58621503ae86ee217b0ce27d256f2 (patch) | |
| tree | f3f5febd769aa66a0c16effc7490242c7f2f2a8d /js | |
| parent | 93e00d5aabad21548f3a4c0986c0b6578773fc35 (diff) | |
Add the ability to copy an existing filter.
Diffstat (limited to 'js')
| -rw-r--r-- | js/PrefFilterTree.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index 4ccddfa75..10c4d7de3 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -167,6 +167,28 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio return false; }, + copySelectedFilters: function() { + const sel_rows = this.getSelectedFilters(); + + if (sel_rows.length > 0) { + if (confirm(__("Copy selected filters?"))) { + Notify.progress("Copying selected filters..."); + + const query = { + op: "Pref_Filters", method: "copy", + ids: sel_rows.toString() + }; + + xhr.post("backend.php", query, () => { + this.reload(); + }); + } + } else { + alert(__("No filters selected.")); + } + + return false; + }, }); }); |