Corrected click event behavior of the captcha refresh button

This commit is contained in:
Alex Tselegidis 2020-12-14 10:48:36 +02:00
parent 122f2aef85
commit f77ceeff84
3 changed files with 6 additions and 4 deletions

View file

@ -363,7 +363,9 @@
<div class="col-12 col-md-6"> <div class="col-12 col-md-6">
<h4 class="captcha-title"> <h4 class="captcha-title">
CAPTCHA CAPTCHA
<small class="fas fa-sync-alt"></small> <button class="btn btn-link text-dark text-decoration-none py-0">
<i class="fas fa-sync-alt"></i>
</button>
</h4> </h4>
<img class="captcha-image" src="<?= site_url('captcha') ?>"> <img class="captcha-image" src="<?= site_url('captcha') ?>">
<input class="captcha-text form-control" type="text" value=""/> <input class="captcha-text form-control" type="text" value=""/>

View file

@ -433,7 +433,7 @@ window.FrontendBook = window.FrontendBook || {};
* *
* @param {jQuery.Event} event * @param {jQuery.Event} event
*/ */
$('.captcha-title svg').on('click', function (event) { $('.captcha-title button').on('click', function (event) {
$('.captcha-image').attr('src', GlobalVariables.baseUrl + '/index.php/captcha?' + Date.now()); $('.captcha-image').attr('src', GlobalVariables.baseUrl + '/index.php/captcha?' + Date.now());
}); });

View file

@ -194,7 +194,7 @@ window.FrontendBookApi = window.FrontendBookApi || {};
$('#captcha-hint').fadeTo(400, 0); $('#captcha-hint').fadeTo(400, 0);
}, 3000); }, 3000);
$('.captcha-title svg').trigger('click'); $('.captcha-title button').trigger('click');
$captchaText.closest('.form-group').addClass('has-error'); $captchaText.closest('.form-group').addClass('has-error');
@ -205,7 +205,7 @@ window.FrontendBookApi = window.FrontendBookApi || {};
+ '/index.php/appointments/book_success/' + response.appointment_hash; + '/index.php/appointments/book_success/' + response.appointment_hash;
}) })
.fail(function (jqxhr, textStatus, errorThrown) { .fail(function (jqxhr, textStatus, errorThrown) {
$('.captcha-title svg').trigger('click'); $('.captcha-title button').trigger('click');
}) })
.always(function () { .always(function () {
$layer.remove(); $layer.remove();