Disable terms / signature button to prevent double click

This commit is contained in:
Benjamin Beganović 2021-12-15 10:25:13 +01:00
parent 81d9e7a6ec
commit c6a5524979
2 changed files with 6 additions and 2 deletions

View File

@ -28,7 +28,7 @@
</button>
</div>
<div class="mt-3 flex w-full rounded-md shadow-sm sm:mt-0 sm:w-auto">
<button @click="document.getElementById('displaySignatureModal').style.display = 'none';" type="button" class="button button-secondary">
<button onclick="document.getElementById('displaySignatureModal').style.display = 'none'; setTimeout(() => this.disabled = true, 0); setTimeout(() => this.disabled = false, 5000); return true;" type="button" class="button button-secondary">
{{ ctrans('texts.close') }}
</button>
</div>

View File

@ -25,7 +25,11 @@
</div>
<div class="mt-5 sm:mt-4 sm:flex sm:flex-row-reverse">
<div class="flex w-full rounded-md shadow-sm sm:ml-3 sm:w-auto">
<button type="button" id="accept-terms-button" class="button button-primary bg-primary">
<button
type="button"
id="accept-terms-button"
onclick="setTimeout(() => this.disabled = true, 0); setTimeout(() => this.disabled = false, 5000); return true;"
class="button button-primary bg-primary">
{{ ctrans('texts.i_agree') }}
</button>
</div>