speichern ohne blur
This commit is contained in:
@@ -1 +1 @@
|
|||||||
1.2.59
|
1.2.60
|
||||||
@@ -543,7 +543,8 @@
|
|||||||
}
|
}
|
||||||
return rawHtml;
|
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
|
// 2. KRITISCH: Holt die JSON-Repräsentation des Editors
|
||||||
let jsonProjectDataRaw = '';
|
let jsonProjectDataRaw = '';
|
||||||
try {
|
try {
|
||||||
@@ -553,6 +554,17 @@
|
|||||||
console.error('[bridge-blocks-api] getProjectData stringify failed', e);
|
console.error('[bridge-blocks-api] getProjectData stringify failed', e);
|
||||||
jsonProjectDataRaw = '';
|
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 resource = 'content';
|
||||||
const action = `${resource}.update`;
|
const action = `${resource}.update`;
|
||||||
|
|||||||
Reference in New Issue
Block a user