2024-07-12 12:58:34 +02:00
|
|
|
import DisplayManager from './common/display-manager/DisplayManager';
|
|
|
|
import moveWrappedElements from './common/wrapped-elements';
|
2023-09-14 17:48:46 +01:00
|
|
|
|
2024-07-12 12:58:34 +02:00
|
|
|
document.addEventListener( 'DOMContentLoaded', () => {
|
|
|
|
// Wait for current execution context to end.
|
|
|
|
setTimeout( function () {
|
|
|
|
moveWrappedElements();
|
|
|
|
}, 0 );
|
2023-09-14 17:48:46 +01:00
|
|
|
|
2024-07-12 12:58:34 +02:00
|
|
|
// Initialize DisplayManager.
|
|
|
|
const displayManager = new DisplayManager();
|
2023-09-14 17:48:46 +01:00
|
|
|
|
2024-07-12 12:58:34 +02:00
|
|
|
jQuery( '*[data-ppcp-display]' ).each( ( index, el ) => {
|
|
|
|
const rules = jQuery( el ).data( 'ppcpDisplay' );
|
|
|
|
for ( const rule of rules ) {
|
|
|
|
displayManager.addRule( rule );
|
|
|
|
}
|
|
|
|
} );
|
2023-09-14 17:48:46 +01:00
|
|
|
|
2024-07-12 12:58:34 +02:00
|
|
|
displayManager.register();
|
|
|
|
} );
|