aboutsummaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2020-02-04 22:24:36 +0100
committerAlex Shpak <alex-shpak@users.noreply.github.com>2020-02-04 22:24:36 +0100
commitc0bd5b5bb899343ef8b18cceec1982ab8980b236 (patch)
treed2d7f730a4facbcdd156806c37bc9eb7c4027071 /assets
parent83f6c3d4755fcdb5ffd0d6720d888f73fd9fd828 (diff)
#90, Move inline scripts to file in assets to allow overwrite
Diffstat (limited to 'assets')
-rw-r--r--assets/menu-reset.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/assets/menu-reset.js b/assets/menu-reset.js
new file mode 100644
index 0000000..f3b90c5
--- /dev/null
+++ b/assets/menu-reset.js
@@ -0,0 +1,7 @@
+(function() {
+ var menu = document.querySelector("aside.book-menu nav");
+ addEventListener("beforeunload", function(event) {
+ localStorage.setItem("menu.scrollTop", menu.scrollTop);
+ });
+ menu.scrollTop = localStorage.getItem("menu.scrollTop");
+})();