Remove the data if needed

This commit is contained in:
Cryptkeeper 2016-02-01 05:23:42 -06:00
parent 01c427eea2
commit 1e5b5efc48
2 changed files with 16 additions and 2 deletions

@ -216,7 +216,11 @@ function setAllGraphVisibility(visible) {
historyPlot.draw();
// Update our localStorage
saveGraphControls(Object.keys(displayedGraphData));
if (visible) {
resetGraphControls();
} else {
saveGraphControls(Object.keys(displayedGraphData));
}
}
function toggleControlsDrawer() {
@ -470,6 +474,10 @@ $(document).ready(function() {
historyPlot.draw();
// Update our localStorage
saveGraphControls(Object.keys(displayedGraphData));
if (Object.keys(hiddenGraphData).length === 0) {
resetGraphControls();
} else {
saveGraphControls(Object.keys(displayedGraphData));
}
});
});

@ -20,6 +20,12 @@ function loadGraphControls() {
}
}
function resetGraphControls() {
if (typeof(localStorage) !== undefined) {
localStorage.removeItem('displayedServers');
}
}
function getTimestamp(ms, timeOnly) {
var date = new Date(0);