2023-09-14 17:48:46 +01:00
|
|
|
import FieldDisplayManager from "./common/FieldDisplayManager";
|
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
|
|
|
|
|
|
|
|
|
|
|
// Initialize FieldDisplayManager.
|
|
|
|
const fieldDisplayManager = new FieldDisplayManager();
|
|
|
|
|
|
|
|
jQuery( '*[data-ppcp-display]' ).each( (index, el) => {
|
|
|
|
const rules = jQuery(el).data('ppcpDisplay');
|
|
|
|
for (const rule of rules) {
|
|
|
|
fieldDisplayManager.addRule(rule);
|
|
|
|
}
|
|
|
|
});
|
2023-08-11 10:35:50 +01:00
|
|
|
}
|
|
|
|
);
|