mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Hide terms and conditions checkbox before Fastlane authentication
This commit is contained in:
parent
9ff89f16f0
commit
5a037b1c93
1 changed files with 16 additions and 0 deletions
|
@ -162,6 +162,20 @@ class AxoManager {
|
|||
ev.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// Listening to status update event
|
||||
document.addEventListener('axo_status_updated', (ev) => {
|
||||
const termsField = document.querySelector("[name='terms-field']");
|
||||
if(termsField) {
|
||||
const status = ev.detail;
|
||||
|
||||
if(status.active && status.validEmail === false && status.hasProfile === false) {
|
||||
termsField.parentElement.style.display = 'none';
|
||||
} else {
|
||||
termsField.parentElement.style.display = 'block';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
rerender() {
|
||||
|
@ -347,6 +361,8 @@ class AxoManager {
|
|||
|
||||
log('Status updated', JSON.parse(JSON.stringify(this.status)));
|
||||
|
||||
document.dispatchEvent(new CustomEvent("axo_status_updated", {detail: this.status}));
|
||||
|
||||
this.rerender();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue