diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index b62e2811..ef0d9209 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -519,9 +519,9 @@ $(document).ready(function() { $("#resetButton").click(function() { resetColumnsFilters(); + hideResetButton(); + // Trigger table update tableApi.draw(); - $("#resetButton").text(""); - $("#resetButton").hide(); }); var chkbox_data = localStorage.getItem("query_log_filter_chkbox"); @@ -543,7 +543,9 @@ function resetColumnsFilters() { tableApi.columns()[0].forEach(function(index) { tableApi.column(index).search("", true, true); }); - $("#resetButton").text(""); + // Clear filter reset button + hideResetButton(); + // Trigger table update tableApi.draw(); } @@ -556,3 +558,9 @@ function showResetButton(type, param) { } button.show(); } + +function hideResetButton() { + let button = $("#resetButton"); + button.text(""); + button.hide(); +}