add csp
This commit is contained in:
@@ -13,6 +13,16 @@ export default class extends HTMLElement {
|
||||
this.input.classList.remove('w-60')
|
||||
}
|
||||
})
|
||||
|
||||
this.button.addEventListener('click', (event) => {
|
||||
event.preventDefault()
|
||||
|
||||
if (this.input.value || document.activeElement === this.input) {
|
||||
return
|
||||
}
|
||||
|
||||
this.input.focus()
|
||||
})
|
||||
}
|
||||
|
||||
get input () {
|
||||
@@ -22,4 +32,8 @@ export default class extends HTMLElement {
|
||||
get title () {
|
||||
return document.querySelector(this.dataset.title)
|
||||
}
|
||||
|
||||
get button () {
|
||||
return this.querySelector('button')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user