ohne blur

This commit is contained in:
2026-02-05 02:28:37 +01:00
parent a8e606a27f
commit fe45e51aa0
2 changed files with 24 additions and 2 deletions

View File

@@ -1 +1 @@
1.2.55 1.2.56

View File

@@ -584,6 +584,28 @@
} catch {} } catch {}
// 1. Daten extrahieren // 1. Daten extrahieren
// Force-Sync: alle Text-Components aus der View ins Model schreiben,
// damit Save ohne Blur nicht den letzten UI-Stand verliert.
try {
const wrapper = editor.getWrapper && editor.getWrapper();
if (wrapper && wrapper.find) {
const texts = wrapper.find('[data-gjs-type="text"]') || [];
texts.forEach((comp) => {
if (!comp || !comp.set) return;
const type = comp.get ? comp.get('type') : null;
if (type && type !== 'text' && type !== 'textnode') return;
const el = comp.view && comp.view.el;
if (!el) return;
const html = el.innerHTML || '';
const before = typeof comp.get === 'function' ? (comp.get('content') || '') : '';
if (html !== before) {
comp.set('content', html);
comp.trigger && comp.trigger('change:content');
}
});
}
} catch {}
const fontCss = (B && typeof B.RTE_FONT_FACE_CSS === 'string' && B.RTE_FONT_FACE_CSS.trim()) const fontCss = (B && typeof B.RTE_FONT_FACE_CSS === 'string' && B.RTE_FONT_FACE_CSS.trim())
? B.RTE_FONT_FACE_CSS.trim() ? B.RTE_FONT_FACE_CSS.trim()
: ''; : '';
@@ -701,7 +723,7 @@
log('SAVE SUCCESS', `Speichern erfolgreich für Aktion ${action}.`, '#008000', 'info'); log('SAVE SUCCESS', `Speichern erfolgreich für Aktion ${action}.`, '#008000', 'info');
// 💡 HINZUGEFÜGT: Bestätigung an das Elternfenster senden // 💡 HINZUGEFÜGT: Bestätigung an das Elternfenster senden
window.parent.postMessage({ source: 'editor', type: 'save:success' }, '*'); window.parent.postMessage({ source: 'editor', type: 'save:success' }, '*');
editor.refresh(); // Optional: Editor-Ansicht aktualisieren // Kein refresh, um UI-Text nicht zu verlieren falls noch nicht gesynct
} }
}) })
.catch(error => { .catch(error => {