From 1ccd27ff57ba5d30bee2c6c9a66d97f6a274ae33 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 25 Mar 2024 05:31:26 +0100 Subject: [PATCH] Do not redirect outside of settings pages on basic level and empty pages Signed-off-by: DL6ER --- scripts/pi-hole/js/footer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js index b1f71557..65726b0b 100644 --- a/scripts/pi-hole/js/footer.js +++ b/scripts/pi-hole/js/footer.js @@ -698,7 +698,12 @@ function applyExpertSettings() { // If we left with an empty page (no visible boxes) after switching from // Expert to Basic settings, redirect to admin/settings/system instead - if ($(".box:visible").length === 0) { + // - class settings-selector is present (this class is present in every + // settings pages, but not in other pages - it is there on the "all" + // settings page as well, even when the button has "only modified" + // functionality there), and + // - there are no visible boxes (the page is empty) + if ($(".settings-selector").length > 0 && $(".box:visible").length === 0) { window.location.href = "/admin/settings/system"; } }