This commit is contained in:
2025-12-09 02:33:49 +01:00
parent 4296c8651f
commit 05b51947ee

View File

@@ -140,6 +140,23 @@
return wrapper; return wrapper;
}; };
const reparseTextComponent = (component, editor) => {
if (!component || typeof component.components !== 'function') return;
const viewEl = component.view && component.view.el;
if (!viewEl) return;
const html = viewEl.innerHTML;
try {
component.components(html);
if (component.em && typeof component.em.trigger === 'function') {
component.em.trigger('component:update', component);
} else if (editor && typeof editor.trigger === 'function') {
editor.trigger('component:update', component);
}
} catch (err) {
log('PLACEHOLDER ERROR', `Reparsing des Text-Elements fehlgeschlagen: ${err && err.message ? err.message : err}`, 'red', 'error');
}
};
const openPlaceholderModal = (editor, component, opts = {}) => { const openPlaceholderModal = (editor, component, opts = {}) => {
if (!editor) return; if (!editor) return;
const modal = editor.Modal; const modal = editor.Modal;
@@ -425,6 +442,7 @@
if (rteInstance && typeof rteInstance.focus === 'function') { if (rteInstance && typeof rteInstance.focus === 'function') {
rteInstance.focus(); rteInstance.focus();
} }
setTimeout(() => reparseTextComponent(target, editor), 0);
return true; return true;
} }
}); });