impress/app/assets/javascripts/items/item_header.js
Emi Matchu 0011fdf76a Move user bulk lists form into a toggleable form, not a dialog
My intent is to next add behavior to save this state across pageloads,
for power users to not have to always reopen it!
2024-01-23 04:20:03 -08:00

13 lines
435 B
JavaScript

const headers = document.querySelectorAll(".item-header");
for (const header of headers) {
try {
const form = header.querySelector(".user-lists-form");
const opener = header.querySelector(".user-lists-form-opener");
opener.addEventListener("click", (event) => {
form.toggleAttribute("hidden");
event.preventDefault();
});
} catch (error) {
console.error(`Error applying dialog behavior to item header:`, error);
}
}