Skip to content

Commit 99ceea4

Browse files
authored
Revert "Load recaptcha related files on focus of the form fields. (#6)"
This reverts commit a3be300.
1 parent a3be300 commit 99ceea4

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

ReCaptchaFrontendUi/view/frontend/web/js/reCaptcha.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,7 @@ define(
2828
*/
2929
initialize: function () {
3030
this._super();
31-
32-
this.attachFocusEvent();
33-
},
34-
35-
attachFocusEvent: function () {
36-
const self = this, $parentForm = $('#' + this.getReCaptchaId() + '-container').parents('form');
37-
38-
$parentForm.one('focus', 'input, select, textarea', function () {
39-
self._loadApi();
40-
});
31+
this._loadApi();
4132
},
4233

4334
/**
@@ -68,7 +59,9 @@ define(
6859
* @returns {Boolean}
6960
*/
7061
getIsInvisibleRecaptcha: function () {
71-
if (this.settings === void 0) {
62+
if (this.settings ===
63+
64+
void 0) {
7265
return false;
7366
}
7467

@@ -102,7 +95,9 @@ define(
10295
widgetId,
10396
parameters;
10497

105-
if (this.captchaInitialized || this.settings === void 0) {
98+
if (this.captchaInitialized || this.settings ===
99+
100+
void 0) {
106101
return;
107102
}
108103

0 commit comments

Comments
 (0)