Ensure large table is only loaded when groups are known.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-12-13 17:54:01 +00:00
parent aa764ad22d
commit aa6c4c88f3
3 changed files with 19 additions and 8 deletions

View File

@@ -28,6 +28,7 @@ function get_groups()
$.post("scripts/pi-hole/php/groups.php", { 'action': 'get_groups', "token":token },
function(data) {
groups = data.data;
initTable();
}, "json");
}
@@ -51,8 +52,11 @@ $(document).ready(function() {
$('#select').on('change', function() {
$("#ip-custom").val("");
$("#ip-custom").prop( "disabled" , $( "#select option:selected" ).val() !== "custom");
});
});
});
function initTable()
{
table = $("#adlistsTable").DataTable( {
"ajax": {
"url": "scripts/pi-hole/php/groups.php",
@@ -129,7 +133,7 @@ $(document).ready(function() {
return data;
}
});
});
}
function addAdlist()
{