Files
docuseal/app/javascript/elements/modal_button.js
T

19 lines
406 B
JavaScript
Raw Normal View History

2026-04-16 12:41:42 +03:00
export default class extends HTMLElement {
connectedCallback () {
const dialog = document.getElementById(this.dataset.target)
this.querySelector('button').addEventListener('click', () => {
if (dialog) {
dialog.inert = false
dialog.showModal()
}
})
if (dialog) {
dialog.addEventListener('close', () => {
dialog.inert = true
})
}
}
}