From 31d0b32103df6b2445a2ce8cf75c7c672b5036e9 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 22 Jul 2019 21:35:42 +0200 Subject: [PATCH] Only show headings when we have domains for the respective list (regex / exact). Signed-off-by: DL6ER --- list.php | 4 ++-- scripts/pi-hole/js/list.js | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/list.php b/list.php index 8d4fc1ba..d6ea04b9 100644 --- a/list.php +++ b/list.php @@ -62,9 +62,9 @@ function getFullName() { -

Exact blocking

+ -

Regex & Wildcard blocking

+ diff --git a/scripts/pi-hole/js/list.js b/scripts/pi-hole/js/list.js index 9a6644ca..09e67736 100644 --- a/scripts/pi-hole/js/list.js +++ b/scripts/pi-hole/js/list.js @@ -75,7 +75,6 @@ function refresh(fade) { } else { - $("h3").show(); if(listType === "white") { data = response.whitelist.sort(); @@ -86,12 +85,20 @@ function refresh(fade) { data = response.blacklist.sort(); data2 = response.regex_blacklist.sort(); } + + if(data.length > 0) + { + $("#h3-exact").show(); + } + if(data2.length > 0) + { + $("#h3-regex").show(); + } + data.forEach(function (entry, index) { addListEntry(entry, index, list, "#list", "exact"); }); - - // Add regex domains if present in returned list data data2.forEach(function (entry, index) { addListEntry(entry, index, listw, "#list-regex", listType+"_regex");