[ticket/15564] Don't use ES2015, it breaks UI tests

PHPBB3-15564
This commit is contained in:
Jakub Senko 2018-04-04 11:20:21 +02:00 committed by Marc Alexander
parent 27153d7e46
commit 772e801d4f

View file

@ -1650,19 +1650,19 @@ phpbb.lazyLoadAvatars = function loadAvatars() {
}); });
}; };
const recaptchaForm = $('.g-recaptcha').parents('form'); var recaptchaForm = $('.g-recaptcha').parents('form');
let submitButton = null; var submitButton = null;
let programaticallySubmitted = false; var programaticallySubmitted = false;
phpbb.recaptchaOnLoad = function () { phpbb.recaptchaOnLoad = function () {
// Listen to submit buttons in order to know which one was pressed // Listen to submit buttons in order to know which one was pressed
$('input[type="submit"]').each(() => { $('input[type="submit"]').each(function () {
$(this).on('click', () => { $(this).on('click', function () {
submitButton = this; submitButton = this;
}); });
}); });
recaptchaForm.on('submit', e => { recaptchaForm.on('submit', function (e) {
if (!programaticallySubmitted) { if (!programaticallySubmitted) {
grecaptcha.execute(); grecaptcha.execute();
e.preventDefault(); e.preventDefault();