This commit is contained in:
2026-01-17 03:45:41 +01:00
parent c36209975c
commit 84aabe7327
2 changed files with 26 additions and 1 deletions

View File

@@ -30,6 +30,7 @@
const installModalGuards = () => {
if (window.__bridgeModalGuardsInstalled) return;
window.__bridgeModalGuardsInstalled = true;
window.__bridgeModalAllowClose = false;
document.addEventListener('click', (evt) => {
const container = evt.target && evt.target.closest
@@ -40,6 +41,12 @@
if (!content) {
evt.preventDefault();
evt.stopPropagation();
return;
}
const closeBtn = evt.target.closest && evt.target.closest('.gjs-mdl-btn-close,[data-bridge-modal-close="1"]');
if (closeBtn) {
window.__bridgeModalAllowClose = true;
setTimeout(() => { window.__bridgeModalAllowClose = false; }, 0);
}
}
}, true);
@@ -570,7 +577,24 @@
// Keep the fix off live updates to avoid cursor jumps; run only on RTE close.
        
        window.__gjs = ed;
window.__gjs = ed;
if (ed && ed.Modal && !ed.Modal.__bridgeCloseGuarded) {
ed.Modal.__bridgeCloseGuarded = true;
ed.Modal.__bridgeOriginalClose = ed.Modal.close ? ed.Modal.close.bind(ed.Modal) : null;
if (ed.Modal.close) {
ed.Modal.close = function (...args) {
if (window.__bridgeModalAllowClose && ed.Modal.__bridgeOriginalClose) {
return ed.Modal.__bridgeOriginalClose(...args);
}
return undefined;
};
}
B.allowModalCloseOnce = () => {
window.__bridgeModalAllowClose = true;
setTimeout(() => { window.__bridgeModalAllowClose = false; }, 0);
};
}
        
        // 🛑 KRITISCHE KORREKTUR 1: Explizite Erstellung aller konfigurierten Kategorien
        ensureConfiguredCategories(ed);