misc: prevent double click in display_message_and_continue.html (#60815)
This commit is contained in:
parent
ecec41b67a
commit
35bf68f922
|
@ -7,9 +7,21 @@
|
|||
</div>
|
||||
{% if only_info %}
|
||||
<script>
|
||||
window.setTimeout(function () {
|
||||
document.getElementById('a2-continue').click();
|
||||
}, 3000);
|
||||
$(function () {
|
||||
var $a2_continue = $('#a2-continue');
|
||||
var clicked = false;
|
||||
$a2_continue.on('click', function (event) {
|
||||
if (! clicked) {
|
||||
# prevent double click for 3 seconds
|
||||
clicked = true;
|
||||
window.setTimeout(function () { clicked = false; }, 3000);
|
||||
} else {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
# automatic click after 3 seconds
|
||||
window.setTimeout(function () { if (!clicked) { $a2_continue.click(); } }, 3000);
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue