This commit is contained in:
2026-01-19 01:41:28 +01:00
parent 647edd0111
commit 5d6d684ccf

View File

@@ -202,9 +202,9 @@
content.style.fontFamily = 'Arial, sans-serif';
content.style.fontSize = '14px';
const initialHtml = (component.get && component.get('content'))
|| (component.view && component.view.el && component.view.el.innerHTML)
|| '';
const modelContent = (component.get && component.get('content')) || '';
const viewHtml = (component.view && component.view.el && component.view.el.innerHTML) || '';
const initialHtml = sanitizeInlineHtml(viewHtml || modelContent, modelContent || '');
content.innerHTML = initialHtml;
const existingStyle = component && component.get && component.get('style') ? component.get('style') : null;
if (existingStyle && typeof existingStyle === 'object') {
@@ -388,9 +388,14 @@
});
return;
}
if (component && component.set) {
const current = component.get && component.get('style') ? { ...component.get('style') } : {};
component.set('style', { ...current, ...styleObj });
if (component && component.setStyle && component.getStyle) {
const current = component.getStyle() || {};
const safeCurrent = (current && typeof current === 'object' && !Array.isArray(current)) ? current : {};
component.setStyle({ ...safeCurrent, ...styleObj });
} else if (component && component.set) {
const current = component.get && component.get('style') ? component.get('style') : {};
const safeCurrent = (current && typeof current === 'object' && !Array.isArray(current)) ? current : {};
component.set('style', { ...safeCurrent, ...styleObj });
}
if (component && component.view && component.view.el) {
Object.entries(styleObj).forEach(([key, val]) => {