Merge pull request #2026 from chrismiceli/issue/1119

1119 Privacy - Query Page and Dom.storage
This commit is contained in:
yubiuser
2022-02-10 22:39:39 +01:00
committed by GitHub
5 changed files with 34 additions and 13 deletions

View File

@@ -358,7 +358,7 @@ $(".nav-tabs a").on("shown.bs.tab", function (e) {
// Bar/Smooth chart toggle
$(function () {
var bargraphs = $("#bargraphs");
var chkboxData = localStorage.getItem("barchart_chkbox");
var chkboxData = localStorage ? localStorage.getItem("barchart_chkbox") : null;
if (chkboxData !== null) {
// Restore checkbox state
@@ -366,7 +366,9 @@ $(function () {
} else {
// Initialize checkbox
bargraphs.prop("checked", true);
localStorage.setItem("barchart_chkbox", true);
if (localStorage) {
localStorage.setItem("barchart_chkbox", true);
}
}
bargraphs.click(function () {
@@ -376,7 +378,7 @@ $(function () {
$(function () {
var colorfulQueryLog = $("#colorfulQueryLog");
var chkboxData = localStorage.getItem("colorfulQueryLog_chkbox");
var chkboxData = localStorage ? localStorage.getItem("colorfulQueryLog_chkbox") : null;
if (chkboxData !== null) {
// Restore checkbox state
@@ -384,7 +386,9 @@ $(function () {
} else {
// Initialize checkbox
colorfulQueryLog.prop("checked", false);
localStorage.setItem("colorfulQueryLog_chkbox", false);
if (localStorage) {
localStorage.setItem("colorfulQueryLog_chkbox", false);
}
}
colorfulQueryLog.click(function () {