mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +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();
|
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.
|
// Observes for new buttons.
|
||||||
(new MutationObserver(this.observeElementsCallback.bind(this)))
|
(new MutationObserver(this.observeElementsCallback.bind(this)))
|
||||||
.observe(document.body, { childList: true, subtree: true });
|
.observe(document.body, { childList: true, subtree: true });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue