diff --git a/config/current.ver b/config/current.ver index 3689edd..7b330ae 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.2.55 \ No newline at end of file +1.2.56 \ No newline at end of file diff --git a/public/assets/js/bridge/blocks-api.js b/public/assets/js/bridge/blocks-api.js index a06c088..66ec12f 100644 --- a/public/assets/js/bridge/blocks-api.js +++ b/public/assets/js/bridge/blocks-api.js @@ -584,6 +584,28 @@ } catch {} // 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()) ? B.RTE_FONT_FACE_CSS.trim() : ''; @@ -701,7 +723,7 @@ log('SAVE SUCCESS', `Speichern erfolgreich für Aktion ${action}.`, '#008000', 'info'); // 💡 HINZUGEFÜGT: Bestätigung an das Elternfenster senden 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 => {