diff options
Diffstat (limited to 'layouts/partials/docs/shared.html')
-rw-r--r-- | layouts/partials/docs/shared.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/layouts/partials/docs/shared.html b/layouts/partials/docs/shared.html index 8354e6a..923545a 100644 --- a/layouts/partials/docs/shared.html +++ b/layouts/partials/docs/shared.html @@ -23,4 +23,17 @@ color: {{ default "#004ed0" .Site.Params.BookMenuBundleActiveLinkColor }}; } </style> +{{ end }} + +{{ define "jsmenu" }} +<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> {{ end }}
\ No newline at end of file |