Skip to content

Commit

Permalink
Fix. External forms. Clear service fields fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glomberg committed Dec 27, 2024
1 parent f1abaa3 commit 9977db3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/apbct-public-bundle.min.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions js/src/apbct-public--5--external-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,18 @@ function sendAjaxCheckingFormData(form) {
// MooSend spinner deactivate
apbctMoosendSpinnerToggle(form);
if ( result.apbct === undefined || ! +result.apbct.blocked ) {

Check failure on line 722 in js/src/apbct-public--5--external-forms.js

View workflow job for this annotation

GitHub Actions / ESLint

Block must not be padded by blank lines

// Clear service fields
for (const el of form.querySelectorAll('input[name="apbct_visible_fields"]')) {
el.remove();
}
for (const el of form.querySelectorAll('input[value="cleantalk_force_ajax_check"]')) {
el.remove();
}
for (const el of form.querySelectorAll('input[name="ct_no_cookie_hidden_field"]')) {
el.remove();
}

// Klaviyo integration
if (form.classList !== undefined && form.classList.contains('klaviyo-form')) {
const cover = document.getElementById('apbct-klaviyo-cover');
Expand Down
12 changes: 12 additions & 0 deletions js/src/apbct-public-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4962,6 +4962,18 @@ function sendAjaxCheckingFormData(form) {
// MooSend spinner deactivate
apbctMoosendSpinnerToggle(form);
if ( result.apbct === undefined || ! +result.apbct.blocked ) {

Check failure on line 4964 in js/src/apbct-public-bundle.js

View workflow job for this annotation

GitHub Actions / ESLint

Block must not be padded by blank lines

// Clear service fields
for (const el of form.querySelectorAll('input[name="apbct_visible_fields"]')) {
el.remove();
}
for (const el of form.querySelectorAll('input[value="cleantalk_force_ajax_check"]')) {
el.remove();
}
for (const el of form.querySelectorAll('input[name="ct_no_cookie_hidden_field"]')) {
el.remove();
}

// Klaviyo integration
if (form.classList !== undefined && form.classList.contains('klaviyo-form')) {
const cover = document.getElementById('apbct-klaviyo-cover');
Expand Down

0 comments on commit 9977db3

Please sign in to comment.