Fix Boostrap y Try Cache

This commit is contained in:
2025-09-10 14:20:44 -03:00
parent 6309003536
commit 153c0f92da
14 changed files with 276 additions and 142 deletions

View File

@@ -63,12 +63,15 @@
}
// 5. Una vez cargado, llamar a la función de renderizado
// 5. Una vez cargado, llamar a la función de renderizado
console.log('Bootstrap: JS principal cargado. Buscando EleccionesWidgets.render...');
if (window.EleccionesWidgets && typeof window.EleccionesWidgets.render === 'function') {
console.log('Bootstrap: La función render() FUE ENCONTRADA. Se procederá a llamarla.');
window.EleccionesWidgets.render();
console.log('Bootstrap: La función render existe. Llamando ahora.');
// Encontramos los contenedores aquí y pasamos sus props.
const widgetContainers = document.querySelectorAll('[data-elecciones-widget]');
widgetContainers.forEach(container => {
// 'dataset' es un objeto que contiene todos los atributos data-*
// container.dataset = { eleccionesWidget: 'mapa-municipios', focoMunicipio: 'LA PLATA' }
window.EleccionesWidgets.render(container, container.dataset);
});
} else {
console.error('Bootstrap: ERROR CRÍTICO - La función render() NO SE ENCONTRÓ en window.EleccionesWidgets.');
console.log('Bootstrap: Contenido de window.EleccionesWidgets:', window.EleccionesWidgets);