mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
28 lines
No EOL
719 B
JavaScript
28 lines
No EOL
719 B
JavaScript
class MiniCartBootstap {
|
|
constructor(renderer, configurator) {
|
|
this.renderer = renderer;
|
|
this.configurator = configurator;
|
|
}
|
|
|
|
init() {
|
|
if (!this.shouldRender()) {
|
|
return;
|
|
}
|
|
|
|
jQuery(document.body).
|
|
on('wc_fragments_loaded wc_fragments_refreshed', () => {
|
|
renderer.render(this.configurator.configuration());
|
|
});
|
|
|
|
this.renderer.render(
|
|
PayPalCommerceGateway.button.mini_cart_wrapper,
|
|
this.configurator.configuration(),
|
|
);
|
|
}
|
|
|
|
shouldRender() {
|
|
return document.querySelector(PayPalCommerceGateway.button.mini_cart_wrapper);
|
|
}
|
|
}
|
|
|
|
export default MiniCartBootstap; |