You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/app/javascript/elements/set_date_button.js

18 lines
515 B

export default class extends HTMLElement {
connectedCallback () {
this.dateFrom = this.dataset.fromValue
this.dateTo = this.dataset.toValue
this.dateFromInput = document.getElementById(this.dataset.fromId)
this.dateToInput = document.getElementById(this.dataset.toId)
this.button.addEventListener('click', () => {
this.dateFromInput.value = this.dateFrom || ''
this.dateToInput.value = this.dateTo || ''
})
}
get button () {
return this.querySelector('button')
}
}