mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-13 10:06:23 +02:00
fixes for acss config. fixes #109
This commit is contained in:
@ -781,20 +781,24 @@ customEditorFontInput, cssSettingsModal, cssSettingsBtn, acssSettingsTextarea
|
||||
d.resolve(result);
|
||||
});
|
||||
} else if (cssMode === CssModes.ACSS) {
|
||||
const html = scope.cm.html.getValue();
|
||||
const foundClasses = atomizer.findClassNames(html);
|
||||
var finalConfig;
|
||||
try {
|
||||
finalConfig = atomizer.getConfig(
|
||||
foundClasses,
|
||||
JSON.parse(scope.acssSettingsCm.getValue())
|
||||
);
|
||||
} catch (e) {
|
||||
finalConfig = atomizer.getConfig(foundClasses, {});
|
||||
if (!window.atomizer) {
|
||||
d.resolve('');
|
||||
} else {
|
||||
const html = scope.cm.html.getValue();
|
||||
const foundClasses = atomizer.findClassNames(html);
|
||||
var finalConfig;
|
||||
try {
|
||||
finalConfig = atomizer.getConfig(
|
||||
foundClasses,
|
||||
JSON.parse(scope.acssSettingsCm.getValue())
|
||||
);
|
||||
} catch (e) {
|
||||
finalConfig = atomizer.getConfig(foundClasses, {});
|
||||
}
|
||||
const acss = atomizer.getCss(finalConfig);
|
||||
scope.cm.css.setValue(acss);
|
||||
d.resolve(acss);
|
||||
}
|
||||
const acss = atomizer.getCss(finalConfig);
|
||||
scope.cm.css.setValue(acss);
|
||||
d.resolve(acss);
|
||||
}
|
||||
|
||||
return d.promise;
|
||||
@ -1872,6 +1876,11 @@ customEditorFontInput, cssSettingsModal, cssSettingsBtn, acssSettingsTextarea
|
||||
|
||||
scope.openCssSettingsModal = function() {
|
||||
scope.toggleModal(cssSettingsModal);
|
||||
setTimeout(() => {
|
||||
// Refresh is required because codemirror gets scaled inside modal and loses alignement.
|
||||
scope.acssSettingsCm.refresh();
|
||||
scope.acssSettingsCm.focus();
|
||||
}, 500);
|
||||
};
|
||||
|
||||
function init() {
|
||||
|
Reference in New Issue
Block a user