Fix 1503
This commit is contained in:
14
Elecciones-Web/frontend/public/bootstrap.js
vendored
14
Elecciones-Web/frontend/public/bootstrap.js
vendored
@@ -1,6 +1,6 @@
|
||||
// frontend/public/bootstrap.js
|
||||
|
||||
(function() {
|
||||
(function () {
|
||||
// El dominio donde se alojan los widgets
|
||||
const WIDGETS_HOST = 'https://elecciones2025.eldia.com';
|
||||
|
||||
@@ -39,10 +39,10 @@
|
||||
if (!entryKey) {
|
||||
throw new Error('No se encontró el punto de entrada en el manifest.');
|
||||
}
|
||||
|
||||
|
||||
const entry = manifest[entryKey];
|
||||
const jsUrl = `${WIDGETS_HOST}/${entry.file}`;
|
||||
|
||||
|
||||
// 3. Cargar el CSS si existe
|
||||
if (entry.css && entry.css.length > 0) {
|
||||
entry.css.forEach(cssFile => {
|
||||
@@ -54,6 +54,14 @@
|
||||
// 4. Cargar el JS principal y esperar a que esté listo
|
||||
await loadScript(jsUrl);
|
||||
|
||||
console.log('Bootstrap: Intentando llamar a render...');
|
||||
if (window.EleccionesWidgets && typeof window.EleccionesWidgets.render === 'function') {
|
||||
console.log('Bootstrap: La función render existe. Llamando ahora.');
|
||||
window.EleccionesWidgets.render();
|
||||
} else {
|
||||
console.error('Bootstrap: La función render no se encontró en window.EleccionesWidgets.');
|
||||
}
|
||||
|
||||
// 5. Una vez cargado, llamar a la función de renderizado
|
||||
if (window.EleccionesWidgets && typeof window.EleccionesWidgets.render === 'function') {
|
||||
window.EleccionesWidgets.render();
|
||||
|
||||
Reference in New Issue
Block a user