mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Fix refresh buttons on show/hide events
This commit is contained in:
parent
e04f76d078
commit
56952abc7d
1 changed files with 5 additions and 0 deletions
|
@ -40,6 +40,11 @@ export class ApmButtons {
|
|||
this.refresh();
|
||||
});
|
||||
|
||||
jQuery(document).on('ppcp-shown ppcp-hidden ppcp-enabled ppcp-disabled', (ev, data) => {
|
||||
this.refresh();
|
||||
setTimeout(this.refresh.bind(this), 200);
|
||||
});
|
||||
|
||||
// Observes for new buttons.
|
||||
(new MutationObserver(this.observeElementsCallback.bind(this)))
|
||||
.observe(document.body, { childList: true, subtree: true });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue