🚧 Persist auto-refresh interval setting
This commit is contained in:
@@ -422,6 +422,13 @@ $(window).on("load", function() {
|
|||||||
disableactionbuttons(true);
|
disableactionbuttons(true);
|
||||||
$("#iform").submit(function() { spinner(); });
|
$("#iform").submit(function() { spinner(); });
|
||||||
$(".spin").click(function() { spinner(); });
|
$(".spin").click(function() { spinner(); });
|
||||||
|
|
||||||
|
// Attempt to load the previously saved interval
|
||||||
|
var savedInterval = localStorage.getItem('bastille_refresh_interval');
|
||||||
|
if (savedInterval !== null) {
|
||||||
|
$("#refresh-interval").val(savedInterval);
|
||||||
|
autoRefresh.interval = parseInt(savedInterval);
|
||||||
|
}
|
||||||
// --- REFRESH INIT ---
|
// --- REFRESH INIT ---
|
||||||
startAutoRefresh();
|
startAutoRefresh();
|
||||||
|
|
||||||
@@ -429,8 +436,10 @@ $(window).on("load", function() {
|
|||||||
updateJailTable();
|
updateJailTable();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// save interval value in local storage
|
||||||
$("#refresh-interval").change(function() {
|
$("#refresh-interval").change(function() {
|
||||||
var val = parseInt($(this).val());
|
var val = parseInt($(this).val());
|
||||||
|
localStorage.setItem('bastille_refresh_interval', val);
|
||||||
stopAutoRefresh();
|
stopAutoRefresh();
|
||||||
if (val > 0) {
|
if (val > 0) {
|
||||||
autoRefresh.interval = val;
|
autoRefresh.interval = val;
|
||||||
|
|||||||
Reference in New Issue
Block a user