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