Removes console log and checks if ctEvents are available before using it.
This commit is contained in:
parent
9d7d97ebfa
commit
8c315eb10d
|
@ -1,14 +1,15 @@
|
|||
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) {
|
||||
(Object.values(tainacan_plugin.tainacan_media_components) || []).forEach((component) => {
|
||||
new tainacan_plugin.classes.TainacanMediaGallery(
|
||||
component.has_media_thumbs ? '#' + component.media_thumbs_id : null,
|
||||
component.has_media_main ? '#' + component.media_main_id : null,
|
||||
component
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
document.dispatchEvent(new Event('TainacanReloadItemsListComponent'));
|
||||
});
|
||||
/* Handles updating Media Items component when reloading page from customizer */
|
||||
if (window.ctEvents && window.ctEvents.default) {
|
||||
window.ctEvents.default.on('blocksy:frontend:init', () => {
|
||||
if (tainacan_plugin?.classes?.TainacanMediaGallery && tainacan_plugin?.tainacan_media_components) {
|
||||
(Object.values(tainacan_plugin.tainacan_media_components) || []).forEach((component) => {
|
||||
new tainacan_plugin.classes.TainacanMediaGallery(
|
||||
component.has_media_thumbs ? '#' + component.media_thumbs_id : null,
|
||||
component.has_media_main ? '#' + component.media_main_id : null,
|
||||
component
|
||||
);
|
||||
});
|
||||
}
|
||||
document.dispatchEvent(new Event('TainacanReloadItemsListComponent'));
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue