Sha256: 713bcd434d424894dfbd4aa314ab421e478697ba559e85e1c7a3b8a3f486609d
Contents?: true
Size: 904 Bytes
Versions: 3
Compression:
Stored size: 904 Bytes
Contents
document.addEventListener("DOMContentLoaded", () => { const modalId = "LimitAmendmentsModal"; const modalEl = document.getElementById(modalId); const amendButton = document.getElementById("amend-button"); const limitAmendments = modalEl && JSON.parse(modalEl.dataset.limitAmendments); if (!amendButton || !limitAmendments || document.querySelector('a[href^="/users/sign_in"]')) { return; } modalEl.querySelectorAll("a").forEach((aEl) => { aEl.addEventListener("click", () => { window.Decidim.currentDialogs[modalId].close(); }); }); /** * Determines if the modal should be displayed based on its current state and data attributes. */ amendButton.addEventListener("click", (event) => { const modal = window.Decidim.currentDialogs[modalId]; if (modal) { event.preventDefault(); event.stopPropagation(); modal.open(); } }); });
Version data entries
3 entries across 3 versions & 1 rubygems