mirror of https://github.com/jlelse/GoBlog
16 lines
516 B
JavaScript
16 lines
516 B
JavaScript
|
(function () {
|
||
|
Array.from(document.querySelectorAll('form input.confirm')).forEach(element => {
|
||
|
let showed = false
|
||
|
element.form.addEventListener('submit', event => {
|
||
|
if (!showed) {
|
||
|
event.preventDefault()
|
||
|
element.value = '…'
|
||
|
setTimeout(() => {
|
||
|
element.value = element.dataset.confirmmessage
|
||
|
showed = true
|
||
|
}, 1000)
|
||
|
return false
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
})()
|