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

@@ -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);