Removes console log and checks if ctEvents are available before using it.
This commit is contained in:
parent
9d7d97ebfa
commit
8c315eb10d
|
@ -1,5 +1,6 @@
|
||||||
|
/* Handles updating Media Items component when reloading page from customizer */
|
||||||
|
if (window.ctEvents && window.ctEvents.default) {
|
||||||
window.ctEvents.default.on('blocksy:frontend:init', () => {
|
window.ctEvents.default.on('blocksy:frontend:init', () => {
|
||||||
console.log("Resetar mais coisas aqui...", tainacan_plugin);
|
|
||||||
if (tainacan_plugin?.classes?.TainacanMediaGallery && tainacan_plugin?.tainacan_media_components) {
|
if (tainacan_plugin?.classes?.TainacanMediaGallery && tainacan_plugin?.tainacan_media_components) {
|
||||||
(Object.values(tainacan_plugin.tainacan_media_components) || []).forEach((component) => {
|
(Object.values(tainacan_plugin.tainacan_media_components) || []).forEach((component) => {
|
||||||
new tainacan_plugin.classes.TainacanMediaGallery(
|
new tainacan_plugin.classes.TainacanMediaGallery(
|
||||||
|
@ -9,6 +10,6 @@ window.ctEvents.default.on('blocksy:frontend:init', () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
document.dispatchEvent(new Event('TainacanReloadItemsListComponent'));
|
document.dispatchEvent(new Event('TainacanReloadItemsListComponent'));
|
||||||
});
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue