This commit is contained in:
2026-01-29 00:18:25 +01:00
parent c21c7dc796
commit 5f7a25dbab
3 changed files with 9 additions and 2 deletions

View File

@@ -1 +1 @@
1.1.50 1.1.51

View File

@@ -150,6 +150,7 @@
logConsoleSnapshot(editor, component, label) { logConsoleSnapshot(editor, component, label) {
try { try {
if (!this.B || !this.B.DEBUG_RTE) return;
const viewEl = component && component.view ? component.view.el : null; const viewEl = component && component.view ? component.view.el : null;
const modelContent = component && component.get ? String(component.get('content') || '') : ''; const modelContent = component && component.get ? String(component.get('content') || '') : '';
const editorHtml = editor && typeof editor.getHtml === 'function' ? String(editor.getHtml() || '') : ''; const editorHtml = editor && typeof editor.getHtml === 'function' ? String(editor.getHtml() || '') : '';

View File

@@ -332,6 +332,7 @@
// RichText-Editor ausgelagert nach /assets/js/bridge/rte-editor.js // RichText-Editor ausgelagert nach /assets/js/bridge/rte-editor.js
const setupPlainTextPreserver = (editor) => { const setupPlainTextPreserver = (editor) => {
const DEBUG_UI = !!(B && B.DEBUG_UI);
const isTextLike = (model) => !!(model && model.is && (model.is('text') || model.is('button') || model.is('link') || model.is('textnode'))); const isTextLike = (model) => !!(model && model.is && (model.is('text') || model.is('button') || model.is('link') || model.is('textnode')));
const resolveTextModel = (model) => { const resolveTextModel = (model) => {
if (!model) return model; if (!model) return model;
@@ -444,7 +445,9 @@
try { try {
target.set('content', stored.html); target.set('content', stored.html);
target.trigger && target.trigger('change:content'); target.trigger && target.trigger('change:content');
try { console.log('[PLAIN TEXT RESTORE] Inhalt wiederhergestellt.'); } catch {} try {
if (DEBUG_UI) console.log('[PLAIN TEXT RESTORE] Inhalt wiederhergestellt.');
} catch {}
} catch {} } catch {}
}; };
const ensureViewMatchesModel = (model) => { const ensureViewMatchesModel = (model) => {
@@ -547,6 +550,7 @@
const setupBlurLogger = (editor) => { const setupBlurLogger = (editor) => {
if (!editor || !editor.Canvas || !editor.Canvas.getBody) return; if (!editor || !editor.Canvas || !editor.Canvas.getBody) return;
const DEBUG_UI = !!(B && B.DEBUG_UI);
const getModelHtmlForLog = (model) => { const getModelHtmlForLog = (model) => {
if (!model) return ''; if (!model) return '';
let html = ''; let html = '';
@@ -576,6 +580,7 @@
}; };
const logComponentInput = (model, label) => { const logComponentInput = (model, label) => {
try { try {
if (!DEBUG_UI) return;
const modelType = model && model.get ? model.get('type') : undefined; const modelType = model && model.get ? model.get('type') : undefined;
let selectedEl = model && model.view && model.view.el; let selectedEl = model && model.view && model.view.el;
if (!selectedEl && editor && editor.Canvas && editor.Canvas.getBody) { if (!selectedEl && editor && editor.Canvas && editor.Canvas.getBody) {
@@ -711,6 +716,7 @@
const isEditable = !!(target.isContentEditable || (target.getAttribute && target.getAttribute('contenteditable') === 'true')); const isEditable = !!(target.isContentEditable || (target.getAttribute && target.getAttribute('contenteditable') === 'true'));
if (!isEditable) return; if (!isEditable) return;
syncFromBlur(evt); syncFromBlur(evt);
if (!DEBUG_UI) return;
const selected = editor.getSelected && editor.getSelected(); const selected = editor.getSelected && editor.getSelected();
const selectedEl = selected && selected.view && selected.view.el; const selectedEl = selected && selected.view && selected.view.el;
const inSelected = !!(selectedEl && (selectedEl === target || selectedEl.contains(target))); const inSelected = !!(selectedEl && (selectedEl === target || selectedEl.contains(target)));