From 4964c4cb203a0d027eb05eff02307b31328968af Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sun, 29 Jun 2025 21:20:38 +0200 Subject: [PATCH] reset scroll when clicking on a sidebar link --- static/webui/script.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/webui/script.js b/static/webui/script.js index 9948247c..f648809c 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -2738,3 +2738,9 @@ function handleValenceBonusChange(event) { }); }); } + +document.querySelectorAll("#sidebar .nav-link").forEach(function (elm) { + elm.addEventListener("click", function () { + window.scrollTo(0, 0); + }); +});