speichern ohne blur
This commit is contained in:
@@ -543,7 +543,8 @@
|
||||
}
|
||||
return rawHtml;
|
||||
};
|
||||
const htmlContent = serializeHtml() + '<style>' + cssPayload + '</style>';
|
||||
const htmlBody = serializeHtml();
|
||||
const htmlContent = htmlBody + '<style>' + cssPayload + '</style>';
|
||||
// 2. KRITISCH: Holt die JSON-Repräsentation des Editors
|
||||
let jsonProjectDataRaw = '';
|
||||
try {
|
||||
@@ -553,6 +554,17 @@
|
||||
console.error('[bridge-blocks-api] getProjectData stringify failed', e);
|
||||
jsonProjectDataRaw = '';
|
||||
}
|
||||
// Wenn gerade aktiv editiert wird, JSON durch HTML ersetzen,
|
||||
// damit der Live-Text ohne Blur gespeichert wird.
|
||||
try {
|
||||
const doc = editor.Canvas && editor.Canvas.getDocument ? editor.Canvas.getDocument() : null;
|
||||
const selectionNode = doc && doc.getSelection ? (doc.getSelection().focusNode || doc.getSelection().anchorNode) : null;
|
||||
const selectionEl = selectionNode ? (selectionNode.nodeType === 1 ? selectionNode : selectionNode.parentElement) : null;
|
||||
const isEditable = !!(selectionEl && (selectionEl.isContentEditable || (selectionEl.getAttribute && selectionEl.getAttribute('contenteditable') === 'true')));
|
||||
if (isEditable && htmlBody) {
|
||||
jsonProjectDataRaw = htmlBody;
|
||||
}
|
||||
} catch {}
|
||||
|
||||
const resource = 'content';
|
||||
const action = `${resource}.update`;
|
||||
|
||||
Reference in New Issue
Block a user