narrow desktop breakpoint constraint relaxed somewhat to accomodate more fringe-case window aspect ratios; #id_gear_btn now, like #id_kit_btn, restyles to contain --quaUser rgb value when menu is active; dashboard.html include ordering switched for #id_dash_applet_menu & #id_gear_btn, to fix an issue causing the menu to overlay the btn instead of the other way around
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Disco DeDisco
2026-03-15 16:39:14 -04:00
parent 2e24175ec8
commit ff7b71792f
8 changed files with 79 additions and 50 deletions

View File

@@ -6,7 +6,9 @@ const initGearMenus = () => {
e.stopPropagation();
const menu = document.getElementById(menuId);
if (!menu) return;
menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
const opening = menu.style.display === 'none' || menu.style.display === '';
menu.style.display = opening ? 'block' : 'none';
gear.classList.toggle('active', opening);
});
document.addEventListener('click', (e) => {
@@ -14,6 +16,7 @@ const initGearMenus = () => {
if (!menu || menu.style.display === 'none') return;
if (e.target.closest('.applet-menu-cancel') || !menu.contains(e.target)) {
menu.style.display = 'none';
gear.classList.remove('active');
}
});
})
@@ -33,5 +36,6 @@ document.body.addEventListener('htmx:afterSwap', (e) => {
document.querySelectorAll('.gear-btn').forEach(gear => {
const menu = document.getElementById(gear.dataset.menuTarget);
if (menu) menu.style.display = 'none';
gear.classList.remove('active');
});
});