From 4772949c68459b3565aeba116246c30c3cccae96 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Wed, 4 Feb 2026 03:04:22 +0100 Subject: [PATCH] ohne blur --- config/current.ver | 2 +- public/assets/js/bridge/blocks-api.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/config/current.ver b/config/current.ver index 6e10d36..c3df286 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.2.46 \ No newline at end of file +1.2.47 \ 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 4152b50..0a8900d 100644 --- a/public/assets/js/bridge/blocks-api.js +++ b/public/assets/js/bridge/blocks-api.js @@ -518,6 +518,28 @@ }; const doc = editor.Canvas && editor.Canvas.getDocument ? editor.Canvas.getDocument() : null; + const syncAllTextComponents = () => { + if (!doc || !wrapper || !wrapper.find) return 0; + const nodes = Array.from(doc.querySelectorAll('[data-gjs-type="text"]')); + let count = 0; + nodes.forEach((el) => { + const id = el.getAttribute && el.getAttribute('id'); + if (!id) return; + const found = wrapper.find(`#${id}`); + const comp = found && found[0]; + if (!comp || !comp.set) return; + const html = el.innerHTML || ''; + const before = typeof comp.get === 'function' ? (comp.get('content') || '') : ''; + if (!html.trim() && String(before || '').trim()) return; + comp.set('content', html); + comp.trigger && comp.trigger('change:content'); + if (editor && typeof editor.trigger === 'function') { + editor.trigger('component:update', comp); + } + count++; + }); + return count; + }; const active = doc && doc.activeElement; if (active) { syncInfo.active = { @@ -560,12 +582,14 @@ } else if (selected && typeof selected.is === 'function' && (selected.is('text') || selected.is('textnode')) && view && view.el) { syncElement(view.el, 'selectedFallback'); } + const syncedAll = syncAllTextComponents(); syncInfo.stage = 'post'; writeDebugLog({ event: 'save:sync', entityId: CURRENT_ENTITY_ID, sectionId: SECTION_ID || null, syncInfo, + syncedAllCount: syncedAll, editorHtmlLen: (editor.getHtml && String(editor.getHtml() || '').length) || 0, editorHtmlPreview: (editor.getHtml && String(editor.getHtml() || '').slice(0, 300)) || '', editorCssLen: (editor.getCss && String(editor.getCss() || '').length) || 0,