aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/docs
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 /layouts/partials/docs
parent83f6c3d4755fcdb5ffd0d6720d888f73fd9fd828 (diff)
#90, Move inline scripts to file in assets to allow overwrite
Diffstat (limited to 'layouts/partials/docs')
-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 }}