aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/docs/menu.html13
1 files changed, 4 insertions, 9 deletions
diff --git a/layouts/partials/docs/menu.html b/layouts/partials/docs/menu.html
index 0db676f..a0d3c45 100644
--- a/layouts/partials/docs/menu.html
+++ b/layouts/partials/docs/menu.html
@@ -13,12 +13,7 @@
</nav>
<!-- Restore menu position as soon as possible to avoid flickering -->
-<script>
-(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");
-})();
-</script>
+{{ $script := resources.Get "menu-reset.js" | resources.Minify }}
+{{ with $script.Content }}
+ <script>{{ . | safeJS }}</script>
+{{ end }}