This commit is contained in:
2026-01-15 02:24:19 +01:00
parent 3a7d0dbb84
commit 80a2a16159
2 changed files with 25 additions and 8 deletions

View File

@@ -123,7 +123,7 @@
// MAP (Registriert als 'std-map')
addOrUpdate(bm, 'std-map', { label:'Karte',
content:`<iframe data-gjs-type="map" src="https://maps.google.com/maps?width=100%25&height=600&hl=de&q=Berlin&t=&z=14&ie=UTF8&iwloc=B&output=embed" width="100%" height="300" frameborder="0" style="${css({'border':'0',width:'100%',height:'300px'})}"></iframe>` });
content:`<iframe data-gjs-type="map" src="https://www.openstreetmap.org/export/embed.html?bbox=13.365%2C52.505%2C13.425%2C52.525&layer=mapnik&marker=52.515%2C13.395" width="100%" height="300" frameborder="0" style="${css({'border':'0',width:'100%',height:'300px'})}"></iframe>` });
// Löst die notwendigen Events für den Bridge Core / Cleanup aus.
editor.trigger('block:add');

View File

@@ -326,6 +326,18 @@
editor.__bridgeRteModalOpen = true;
editor.__bridgeRteAllowClose = false;
let reopenGuard = false;
const closeModal = () => {
editor.__bridgeRteAllowClose = true;
editor.__bridgeRteModalOpen = false;
const mdl = modal.getModel && modal.getModel();
if (modal.__bridgeOriginalClose) {
modal.__bridgeOriginalClose();
} else if (mdl && typeof mdl.set === 'function') {
mdl.set('open', false);
} else if (modal.el) {
modal.el.style.display = 'none';
}
};
if (!modal.__bridgeCloseLocked) {
modal.__bridgeCloseLocked = true;
@@ -335,6 +347,15 @@
editor.__bridgeRteAllowClose = false;
return modal.__bridgeOriginalClose(...args);
}
if (editor.__bridgeRteAllowClose && !modal.__bridgeOriginalClose) {
editor.__bridgeRteAllowClose = false;
const mdl = modal.getModel && modal.getModel();
if (mdl && typeof mdl.set === 'function') {
mdl.set('open', false);
} else if (modal.el) {
modal.el.style.display = 'none';
}
}
};
}
@@ -497,14 +518,12 @@
cancelBtn.style.background = '#f8fafc';
cancelBtn.style.cursor = 'pointer';
cancelBtn.addEventListener('click', () => {
editor.__bridgeRteAllowClose = true;
editor.__bridgeRteModalOpen = false;
modal.close();
closeModal();
});
const saveBtn = doc.createElement('button');
saveBtn.type = 'button';
saveBtn.textContent = 'Uebernehmen';
saveBtn.textContent = 'Speichern';
saveBtn.style.padding = '6px 12px';
saveBtn.style.border = '1px solid #0ea5e9';
saveBtn.style.borderRadius = '4px';
@@ -529,9 +548,7 @@
editor.trigger('component:update', component);
}
} catch {}
editor.__bridgeRteAllowClose = true;
editor.__bridgeRteModalOpen = false;
modal.close();
closeModal();
});
actions.appendChild(cancelBtn);