update buttons after click to prevent dupe actions
This commit is contained in:
parent
86764b327f
commit
1e99e99835
|
@ -20,10 +20,14 @@ function post(url, data) {
|
|||
x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
|
||||
x.send(data)
|
||||
}
|
||||
function bonk(xid) {
|
||||
function bonk(el, xid) {
|
||||
el.innerHTML = "bonked"
|
||||
el.disabled = true
|
||||
post("/bonk", "CSRF={{ $BonkCSRF }}&xid=" + xid)
|
||||
}
|
||||
function zonkit(xid) {
|
||||
function zonkit(el, xid) {
|
||||
el.innerHTML = "zonked"
|
||||
el.disabled = true
|
||||
post("/zonkit", "CSRF={{ $BonkCSRF }}&xid=" + xid)
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -27,8 +27,8 @@ convoy: {{ .Convoy }}
|
|||
{{ end }}
|
||||
{{ if and .Bonk (not (eq .Honk.What "zonked")) }}
|
||||
<p>
|
||||
<button onclick="bonk('{{ .Honk.XID }}'); return false;"><a href="/bonk">bonk</a></button>
|
||||
<button onclick="bonk(this, '{{ .Honk.XID }}'); return false;"><a href="/bonk">bonk</a></button>
|
||||
<button onclick="showhonkform('{{ .Honk.XID }}', '{{ .Honk.Username }}'); return false;"><a href="/newhonk">tonk</a></button>
|
||||
<button onclick="zonkit('{{ .Honk.XID }}'); return false;"><a href="/zonkit">zonk</a></button>
|
||||
<button onclick="zonkit(this, '{{ .Honk.XID }}'); return false;"><a href="/zonkit">zonk</a></button>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue