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,8 +216,12 @@ function setAllGraphVisibility(visible) {
historyPlot.draw(); historyPlot.draw();
// Update our localStorage // Update our localStorage
if (visible) {
resetGraphControls();
} else {
saveGraphControls(Object.keys(displayedGraphData)); saveGraphControls(Object.keys(displayedGraphData));
} }
}
function toggleControlsDrawer() { function toggleControlsDrawer() {
var div = $('#big-graph-controls-drawer'); var div = $('#big-graph-controls-drawer');
@ -470,6 +474,10 @@ $(document).ready(function() {
historyPlot.draw(); historyPlot.draw();
// Update our localStorage // Update our localStorage
if (Object.keys(hiddenGraphData).length === 0) {
resetGraphControls();
} else {
saveGraphControls(Object.keys(displayedGraphData)); saveGraphControls(Object.keys(displayedGraphData));
}
}); });
}); });

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