Sha256: cd5b304d23695d96b3b4e8577428092973d05fbf5cf44ba0b439f9364e40b43a
Contents?: true
Size: 684 Bytes
Versions: 6
Compression:
Stored size: 684 Bytes
Contents
const dialogHelper = () => { const openTrigger = document.querySelectorAll("[data-open-dialog]"); const closeTrigger = document.querySelectorAll("[data-close-dialog]"); openTrigger.forEach((open) => { open.addEventListener("click", () => { var openTriggerData = open.dataset.openDialog; if (document.getElementById(openTriggerData).open) return; document.getElementById(openTriggerData).showModal(); }); }); closeTrigger.forEach((close) => { close.addEventListener("click", () => { var closeTriggerData = close.dataset.closeDialog; document.getElementById(closeTriggerData).close(); }); }); }; export default dialogHelper;
Version data entries
6 entries across 6 versions & 1 rubygems