chore(dialogs): remove excessive duplicate markup for fallback modal hack
This commit is contained in:
parent
33c00fa74b
commit
3d866262ca
12 changed files with 58 additions and 106 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue