mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
26 lines
No EOL
666 B
JavaScript
26 lines
No EOL
666 B
JavaScript
import Renderer from './Renderer';
|
|
|
|
class MiniCartBootstap {
|
|
constructor(configurator) {
|
|
this.configurator = configurator;
|
|
}
|
|
|
|
init() {
|
|
const miniCartWrapper = PayPalCommerceGateway.button.mini_cart_wrapper;
|
|
|
|
if (!document.querySelector(miniCartWrapper)) {
|
|
return;
|
|
}
|
|
|
|
const renderer = new Renderer(miniCartWrapper);
|
|
|
|
jQuery(document.body).
|
|
on('wc_fragments_loaded wc_fragments_refreshed', () => {
|
|
renderer.render(this.configurator.configuration());
|
|
});
|
|
|
|
renderer.render(this.configurator.configuration());
|
|
}
|
|
}
|
|
|
|
export default MiniCartBootstap; |