aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-06-06 17:16:48 -0400
committerBobby <[email protected]>2023-06-06 17:16:48 -0400
commiteae87af26e0d6561f2220a758968af1232c0bd29 (patch)
treec9d9c232be47a53b315bd70465ed0496ef04efe8
parent5781f104d7ea2a709c1ca3266c407e15224f18b7 (diff)
downloadthatcomputerscientist-eae87af26e0d6561f2220a758968af1232c0bd29.tar.xz
thatcomputerscientist-eae87af26e0d6561f2220a758968af1232c0bd29.zip
Spectacles shall persist across pages
-rw-r--r--static/js/postHandler.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/static/js/postHandler.js b/static/js/postHandler.js
index dd647363..186ac64d 100644
--- a/static/js/postHandler.js
+++ b/static/js/postHandler.js
@@ -78,6 +78,9 @@ function blindMode() {
}
$('#blindStatus').attr('data-status', 'on');
$('#blindStatus').attr('src', onImage);
+
+ // we will allow blind mode to persist across pages, in local storage
+ localStorage.setItem('blindMode', 'on');
} else {
// turn off. Phones - 12px, Desktop - 11px
if (windowWidth < 480) {
@@ -91,9 +94,18 @@ function blindMode() {
}
$('#blindStatus').attr('data-status', 'off');
$('#blindStatus').attr('src', offImage);
+
+ localStorage.setItem('blindMode', 'off');
}
}
+// if localStorage has blindMode set to on, then turn on blindMode
+var blindModeStatus = localStorage.getItem('blindMode');
+console.log(blindModeStatus);
+if (blindModeStatus == 'on') {
+ blindMode();
+}
+
var allInputElementsOnPage = $('input');
// If lights are off, then on hover on sidebar .children(), fadeTo 1 for currently hovered child