0001-misc-prevent-double-click-in-display_message_and_con.patch
src/authentic2/templates/authentic2/display_message_and_continue.html | ||
---|---|---|
7 | 7 |
</div> |
8 | 8 |
{% if only_info %} |
9 | 9 |
<script> |
10 |
window.setTimeout(function () { |
|
11 |
document.getElementById('a2-continue').click(); |
|
12 |
}, 3000); |
|
10 |
$(function () { |
|
11 |
var $a2_continue = $('#a2-continue'); |
|
12 |
var clicked = false; |
|
13 |
$a2_continue.on('click', function (event) { |
|
14 |
if (! clicked) { |
|
15 |
# prevent double click for 3 seconds |
|
16 |
clicked = true; |
|
17 |
window.setTimeout(function () { clicked = false; }, 3000); |
|
18 |
} else { |
|
19 |
event.preventDefault(); |
|
20 |
} |
|
21 |
}); |
|
22 |
# automatic click after 3 seconds |
|
23 |
window.setTimeout(function () { if (!clicked) { $a2_continue.click(); } }, 3000); |
|
24 |
}); |
|
13 | 25 |
</script> |
14 | 26 |
{% endif %} |
15 | 27 |
{% endblock %} |
16 |
- |