Skip to content

Commit

Permalink
Update Agones Site: Preserve and Restore Side Menu Scroll Position (#…
Browse files Browse the repository at this point in the history
…3805)

Co-authored-by: Robert Bailey <[email protected]>
  • Loading branch information
Kalaiselvi84 and roberthbailey committed Apr 25, 2024
1 parent 55e7bab commit db84735
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions site/layouts/partials/hooks/body-end.html
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
<script src={{ "js/asciinema-player.js" | absURL }}></script>

<!-- script to preserve and restore the side menu scroll position -->
<script >
(function() {
var a = document.querySelector("#td-section-nav");
addEventListener("beforeunload", function(b) {
localStorage.setItem("menu.scrollTop", a.scrollTop)
}), a.scrollTop = localStorage.getItem("menu.scrollTop")
})()
</script>

0 comments on commit db84735

Please sign in to comment.