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