sadsa
This commit is contained in:
@@ -317,8 +317,14 @@
|
||||
{ label: 'Trebuchet MS', value: 'Trebuchet MS, sans-serif' },
|
||||
{ label: 'Verdana', value: 'Verdana, sans-serif' },
|
||||
];
|
||||
const applyComponentStyle = (styleObj) => {
|
||||
const applyComponentStyle = (styleObj, opts = {}) => {
|
||||
try {
|
||||
if (opts.preview && content) {
|
||||
Object.entries(styleObj).forEach(([key, val]) => {
|
||||
content.style[key] = val;
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (component && component.set) {
|
||||
const current = component.get && component.get('style') ? { ...component.get('style') } : {};
|
||||
component.set('style', { ...current, ...styleObj });
|
||||
@@ -333,7 +339,7 @@
|
||||
|
||||
addSelect([{ label: 'Schriftart', value: '' }, ...fontOptions], 'Schriftart', (value) => {
|
||||
if (!value) return;
|
||||
applyComponentStyle({ fontFamily: value });
|
||||
applyComponentStyle({ fontFamily: value }, { preview: true });
|
||||
});
|
||||
addSelect([
|
||||
{ label: 'Groesse', value: '' },
|
||||
@@ -418,8 +424,12 @@
|
||||
modal.setContent(container);
|
||||
const mdl = modal.getModel && modal.getModel();
|
||||
if (mdl && mdl.set) {
|
||||
mdl.set('closeOnEsc', true);
|
||||
mdl.set('closeOnClick', true);
|
||||
mdl.set('closeOnEsc', false);
|
||||
mdl.set('closeOnClick', false);
|
||||
}
|
||||
if (modal.el) {
|
||||
const closeBtn = modal.el.querySelector('.gjs-mdl-btn-close');
|
||||
if (closeBtn) closeBtn.style.display = 'none';
|
||||
}
|
||||
modal.open();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user