mirror of
https://github.com/docusealco/docuseal.git
synced 2026-08-07 07:14:43 +00:00
18 lines
469 B
JavaScript
18 lines
469 B
JavaScript
export default class extends HTMLElement {
|
|
connectedCallback () {
|
|
this.button.addEventListener('click', () => {
|
|
const expirationDate = new Date()
|
|
|
|
expirationDate.setFullYear(expirationDate.getFullYear() + 10)
|
|
|
|
const expires = expirationDate.toUTCString()
|
|
|
|
document.cookie = this.dataset.key + '=' + this.dataset.value + '; expires=' + expires + '; path=/'
|
|
})
|
|
}
|
|
|
|
get button () {
|
|
return this.querySelector('button, label')
|
|
}
|
|
}
|