From 95575bef5f4aee88b813e3f317cabf88828489a0 Mon Sep 17 00:00:00 2001 From: Christophe Date: Tue, 14 Apr 2026 22:40:40 +0200 Subject: [PATCH] Corrige le masquage du menu au scroll --- .../wwwroot/js/chesscubing-interop.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ChessCubing.App/wwwroot/js/chesscubing-interop.js b/ChessCubing.App/wwwroot/js/chesscubing-interop.js index 71d2499..d3bf853 100644 --- a/ChessCubing.App/wwwroot/js/chesscubing-interop.js +++ b/ChessCubing.App/wwwroot/js/chesscubing-interop.js @@ -6,6 +6,7 @@ let menuScrollStarted = false; let menuLastScrollY = 0; let menuAnimationFrame = 0; + let appliedBodyStateClasses = []; function syncViewportHeight() { const visibleHeight = window.visualViewport?.height ?? window.innerHeight; @@ -166,7 +167,20 @@ delete document.body.dataset.page; } - document.body.className = bodyClass || ""; + for (const className of appliedBodyStateClasses) { + document.body.classList.remove(className); + } + + appliedBodyStateClasses = (bodyClass || "") + .split(/\s+/) + .map((value) => value.trim()) + .filter((value) => value.length > 0); + + if (appliedBodyStateClasses.length > 0) { + document.body.classList.add(...appliedBodyStateClasses); + } + + queueMenuVisibilitySync(); }, };