mirror of
https://github.com/pi-hole/web.git
synced 2025-12-26 13:36:22 +00:00
Remove heading when list goes empty.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -119,13 +119,16 @@ function refresh(fade) {
|
||||
window.onload = refresh(false);
|
||||
|
||||
function sub(index, entry, arg) {
|
||||
var domain = $("#list #"+index);
|
||||
var list = "#list";
|
||||
var heading = "#h3-exact";
|
||||
var locallistType = listType;
|
||||
if(arg === "black_regex" || arg === "white_regex")
|
||||
{
|
||||
list = "#list-regex";
|
||||
heading = "#h3-regex";
|
||||
locallistType = arg;
|
||||
domain = $("#list-regex #"+index);
|
||||
}
|
||||
var domain = $(list+" #"+index);
|
||||
domain.hide("highlight");
|
||||
$.ajax({
|
||||
url: "scripts/pi-hole/php/sub.php",
|
||||
@@ -136,6 +139,10 @@ function sub(index, entry, arg) {
|
||||
return;
|
||||
}
|
||||
domain.remove();
|
||||
if($(list+" li").length < 1)
|
||||
{
|
||||
$(heading).hide();
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, exception) {
|
||||
alert("Failed to remove the domain!");
|
||||
|
||||
Reference in New Issue
Block a user