mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
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:
@@ -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> & 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> & Wildcard blocking</h3>
|
||||
<ul class="list-group" id="list-regex"></ul>
|
||||
|
||||
<script src="scripts/pi-hole/js/list.js"></script>
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user