fix "remove" button in /live

master
Aevann1 2022-10-08 08:13:35 +02:00
parent 55c62b820f
commit 1236d7bcd5
2 changed files with 5 additions and 9 deletions

View File

@ -340,15 +340,12 @@ function timestamp(str, ti) {
};
function areyousure(t) {
if (t.value) {
t.type = 'submit';
if (t.value)
t.value = 'Are you sure?'
}
else
{
t.innerHTML = t.innerHTML.replace(t.textContent, 'Are you sure?')
}
t.setAttribute("onclick", t.dataset.click);
t.setAttribute("onclick", t.dataset.click);
if (t.dataset.dismiss)
t.setAttribute("data-bs-dismiss", t.dataset.dismiss);

View File

@ -59,8 +59,7 @@
<form action="/live/remove" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input type="hidden" name="id" value="{{id}}">
<input autocomplete="off" class="btn btn-primary ml-auto donttrigger" data-click="disable(this)" onclick="areyousure(this)" value="Remove">
<input autocomplete="off" class="btn btn-primary ml-auto donttrigger" data-click="disable(this);this.parentElement.submit()" onclick="areyousure(this)" value="Remove">
</form>
</td>
{% endif %}
@ -85,7 +84,7 @@
<form action="/live/remove" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input type="hidden" name="id" value="{{id}}">
<input autocomplete="off" class="btn btn-primary ml-auto donttrigger" data-click="disable(this)" onclick="areyousure(this)" value="Remove">
<input autocomplete="off" class="btn btn-primary ml-auto donttrigger" data-click="disable(this);this.parentElement.submit()" onclick="areyousure(this)" value="Remove">
</form>
</td>
{% endif %}