mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 04:58:28 +08:00
21 lines
596 B
JavaScript
21 lines
596 B
JavaScript
import DisplayManager from './common/display-manager/DisplayManager';
|
|
import moveWrappedElements from './common/wrapped-elements';
|
|
|
|
document.addEventListener( 'DOMContentLoaded', () => {
|
|
// Wait for current execution context to end.
|
|
setTimeout( function () {
|
|
moveWrappedElements();
|
|
}, 0 );
|
|
|
|
// Initialize DisplayManager.
|
|
const displayManager = new DisplayManager();
|
|
|
|
jQuery( '*[data-ppcp-display]' ).each( ( index, el ) => {
|
|
const rules = jQuery( el ).data( 'ppcpDisplay' );
|
|
for ( const rule of rules ) {
|
|
displayManager.addRule( rule );
|
|
}
|
|
} );
|
|
|
|
displayManager.register();
|
|
} );
|