Only show headings when we have domains for the respective list (regex / exact).

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-07-22 21:35:42 +02:00
parent dfcfafd6d9
commit 31d0b32103
2 changed files with 12 additions and 5 deletions
+2 -2
View File
@@ -62,9 +62,9 @@ function getFullName() {
<!-- Domain List -->
<h3>Exact blocking</h3>
<h3 id="h3-exact" hidden="true">Exact blocking</h3>
<ul class="list-group" id="list"></ul>
<h3><a href="https://docs.pi-hole.net/ftldns/regex/overview/" target="_blank" title="Click for Pi-hole Regex documentation">Regex</a> &amp; Wildcard blocking</h3>
<h3 id="h3-regex" hidden="true"><a href="https://docs.pi-hole.net/ftldns/regex/overview/" target="_blank" title="Click for Pi-hole Regex documentation">Regex</a> &amp; Wildcard blocking</h3>
<ul class="list-group" id="list-regex"></ul>
<script src="scripts/pi-hole/js/list.js"></script>
+10 -3
View File
@@ -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");