mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Dispatch hosted fields loaded event
This commit is contained in:
parent
ab32a20f68
commit
da7450ccdf
2 changed files with 3 additions and 2 deletions
|
@ -24,11 +24,11 @@ class CheckoutBootstap {
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
setTimeout(() => {
|
jQuery(document).on('hosted_fields_loaded', () => {
|
||||||
jQuery('#saved-credit-card').on('change', () => {
|
jQuery('#saved-credit-card').on('change', () => {
|
||||||
this.displayPlaceOrderButtonForSavedCreditCards()
|
this.displayPlaceOrderButtonForSavedCreditCards()
|
||||||
})
|
})
|
||||||
}, 3000)
|
});
|
||||||
|
|
||||||
this.switchBetweenPayPalandOrderButton()
|
this.switchBetweenPayPalandOrderButton()
|
||||||
this.displayPlaceOrderButtonForSavedCreditCards()
|
this.displayPlaceOrderButtonForSavedCreditCards()
|
||||||
|
|
|
@ -100,6 +100,7 @@ class CreditCardRenderer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).then(hostedFields => {
|
}).then(hostedFields => {
|
||||||
|
document.dispatchEvent(new CustomEvent("hosted_fields_loaded"));
|
||||||
this.currentHostedFieldsInstance = hostedFields;
|
this.currentHostedFieldsInstance = hostedFields;
|
||||||
|
|
||||||
hostedFields.on('inputSubmitRequest', () => {
|
hostedFields.on('inputSubmitRequest', () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue