From bf6d0f28173ca38968e5a23b86758d1dce133e1d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Feb 2021 10:35:13 +0300 Subject: various dialog-related fixes; stop referring to many dialogs by name; move filter test initial dialog to client side --- js/CommonFilters.js | 15 +++++++++++++-- js/PrefHelpers.js | 31 +++++++++++++------------------ 2 files changed, 26 insertions(+), 20 deletions(-) (limited to 'js') diff --git a/js/CommonFilters.js b/js/CommonFilters.js index 27bf78a02..61e6b2f95 100644 --- a/js/CommonFilters.js +++ b/js/CommonFilters.js @@ -248,10 +248,21 @@ const Filters = { }); }, - href: "backend.php?op=pref-filters&method=testFilterDlg" + content: ` +
+   + Looking for articles... +
+ + + + + ` }); - dojo.connect(test_dlg, "onLoad", null, function (/* e */) { + dojo.connect(test_dlg, "onShow", null, function (/* e */) { test_dlg.getTestResults(params, 0); }); diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js index 966e8151e..dd8fef5c6 100644 --- a/js/PrefHelpers.js +++ b/js/PrefHelpers.js @@ -118,22 +118,6 @@ const Helpers = { alert(__("No profiles selected.")); } }, - activateProfile: function () { - const sel_rows = this.getSelectedProfiles(); - - if (sel_rows.length == 1) { - if (confirm(__("Activate selected profile?"))) { - Notify.progress("Loading, please wait..."); - - xhrPost("backend.php", {op: "rpc", method: "setprofile", id: sel_rows.toString()}, () => { - window.location.reload(); - }); - } - - } else { - alert(__("Please choose a profile to activate.")); - } - }, addProfile: function () { if (this.validate()) { Notify.progress("Creating profile...", true); @@ -148,8 +132,19 @@ const Helpers = { } }, execute: function () { - if (this.validate()) { - // + const sel_rows = this.getSelectedProfiles(); + + if (sel_rows.length == 1) { + if (confirm(__("Activate selected profile?"))) { + Notify.progress("Loading, please wait..."); + + xhrPost("backend.php", {op: "rpc", method: "setprofile", id: sel_rows.toString()}, () => { + window.location.reload(); + }); + } + + } else { + alert(__("Please choose a profile to activate.")); } }, href: query -- cgit v1.2.3