refactor(bulma): Add action dropdown, remove card layout

This commit is contained in:
2025-06-10 20:35:24 +02:00
parent 9265cdaea9
commit 18a2d16bf6
2 changed files with 150 additions and 82 deletions

View File

@@ -40,4 +40,33 @@ document.addEventListener('DOMContentLoaded', () => {
}
});
});
// DROPDOWNS
const $clickableDropdowns = document.querySelectorAll(
".dropdown:not(.is-hoverable)",
);
if ($clickableDropdowns.length > 0) {
$clickableDropdowns.forEach(($dropdown) => {
if (!$dropdown.querySelector("button")) {
return;
}
$dropdown.querySelector("button").addEventListener("click", (event) => {
event.stopPropagation();
$dropdown.classList.toggle("is-active");
});
});
document.addEventListener("click", () => {
closeDropdowns();
});
}
function closeDropdowns() {
$clickableDropdowns.forEach(($el) => {
$el.classList.remove("is-active");
});
}
});