mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Add "Reset Sorting" button to remaining pages.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -127,6 +127,7 @@ function initTable() {
|
||||
},
|
||||
order: [[0, "asc"]],
|
||||
columns: [
|
||||
{ data: "id", visible: false },
|
||||
{ data: "ip" },
|
||||
{ data: "groups", searchable: false },
|
||||
{ data: "name", width: "80px", orderable: false }
|
||||
@@ -209,6 +210,19 @@ function initTable() {
|
||||
return data;
|
||||
}
|
||||
});
|
||||
|
||||
table.on("order.dt", function() {
|
||||
var order = table.order();
|
||||
if (order[0][0] !== 0 || order[0][1] !== "asc") {
|
||||
$("#resetButton").show();
|
||||
} else {
|
||||
$("#resetButton").hide();
|
||||
}
|
||||
});
|
||||
$("#resetButton").on("click", function() {
|
||||
table.order([[0, "asc"]]).draw();
|
||||
$("#resetButton").hide();
|
||||
});
|
||||
}
|
||||
|
||||
function addClient() {
|
||||
|
||||
Reference in New Issue
Block a user