From 87fa180e6779b6b1cbd89368da5dda8b6e72acef Mon Sep 17 00:00:00 2001 From: yubiuser Date: Sun, 16 Aug 2020 23:13:49 +0200 Subject: [PATCH] Remember last used sort column/direction on Local DNS Records table and CNAME table Signed-off-by: yubiuser --- scripts/pi-hole/js/customcname.js | 8 ++++++++ scripts/pi-hole/js/customdns.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/scripts/pi-hole/js/customcname.js b/scripts/pi-hole/js/customcname.js index a5f9edb9..d1a8234e 100644 --- a/scripts/pi-hole/js/customcname.js +++ b/scripts/pi-hole/js/customcname.js @@ -69,6 +69,14 @@ $(function () { [10, 25, 50, 100, -1], [10, 25, 50, 100, "All"] ], + order: [[0, "asc"]], + stateSave: true, + stateSaveCallback: function (settings, data) { + utils.stateSaveCallback("LocalCNAMETable", data); + }, + stateLoadCallback: function () { + return utils.stateLoadCallback("LocalCNAMETable"); + }, drawCallback: function () { $(".deleteCustomCNAME").on("click", deleteCustomCNAME); } diff --git a/scripts/pi-hole/js/customdns.js b/scripts/pi-hole/js/customdns.js index 36987379..0c9f2f74 100644 --- a/scripts/pi-hole/js/customdns.js +++ b/scripts/pi-hole/js/customdns.js @@ -69,6 +69,14 @@ $(function () { [10, 25, 50, 100, -1], [10, 25, 50, 100, "All"] ], + order: [[0, "asc"]], + stateSave: true, + stateSaveCallback: function (settings, data) { + utils.stateSaveCallback("LocalDNSTable", data); + }, + stateLoadCallback: function () { + return utils.stateLoadCallback("LocalDNSTable"); + }, drawCallback: function () { $(".deleteCustomDNS").on("click", deleteCustomDNS); }