From 672411ca7053345634a63dd3eabed75baf93043f Mon Sep 17 00:00:00 2001 From: Inverle Date: Sun, 21 Dec 2025 15:37:23 +0100 Subject: Fix dropdown menus in sidebar going under the navigation bar (#8336) Missed in #8335 because I was testing without having the navigation bar enabled. image --- p/scripts/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p/scripts/main.js b/p/scripts/main.js index 0cdc4d387..3b47beb84 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1112,9 +1112,10 @@ function init_column_categories() { window.addEventListener('hashchange', () => { const dropdownBottom = dropdownMenu.getBoundingClientRect().bottom; const toggleHeight = a.getBoundingClientRect().height; + const navbarHeight = document.querySelector('nav#nav_entries')?.getBoundingClientRect()?.height || 0; // If there is no space to display the dropdown below, display it above - if (dropdownBottom > window.innerHeight) { + if (dropdownBottom > window.innerHeight - navbarHeight) { dropdownMenu.style.bottom = `${toggleHeight + 2}px`; dropdownMenu.classList.add('arrow-bottom'); } -- cgit v1.2.3