chore(dialogs): remove excessive duplicate markup for fallback modal hack

This commit is contained in:
Cory Dransfeldt 2025-04-15 08:48:36 -07:00
parent 33c00fa74b
commit 3d866262ca
No known key found for this signature in database
12 changed files with 58 additions and 106 deletions

View file

@ -1,14 +1,14 @@
window.addEventListener("load", () => {
// dialog controls
(() => {
if (document.querySelectorAll(".modal-open").length) {
document.querySelectorAll(".modal-open").forEach((button) => {
const modalId = button.getAttribute("data-modal-trigger");
const dialog = document.getElementById(`dialog-${modalId}`);
if (document.querySelectorAll(".dialog-open").length) {
document.querySelectorAll(".dialog-open").forEach((button) => {
const dialogId = button.getAttribute("data-dialog-trigger");
const dialog = document.getElementById(`dialog-${dialogId}`);
if (!dialog) return;
const closeButton = dialog.querySelector(".modal-close");
const closeButton = dialog.querySelector(".dialog-close");
button.addEventListener("click", () => {
dialog.showModal();