♻️ Refactor

This commit is contained in:
Liyas Thomas
2020-01-31 00:18:20 +05:30
parent f80c5d6a46
commit 1d6d8af748
5 changed files with 29 additions and 36 deletions

View File

@@ -55,8 +55,8 @@ export default {
mounted() {
const editor = ace.edit(this.$refs.editor, {
theme: "ace/theme/" + this.defineTheme(),
mode: "ace/mode/" + this.lang,
theme: `ace/theme/${this.defineTheme()}`,
mode: `ace/mode/${this.lang}`,
...this.options
});
@@ -74,13 +74,10 @@ export default {
methods: {
defineTheme() {
if (this.theme) {
return this.theme;
} else {
return (
this.$store.state.postwoman.settings.THEME_ACE_EDITOR || DEFAULT_THEME
);
}
if (this.theme) return this.theme;
return (
this.$store.state.postwoman.settings.THEME_ACE_EDITOR || DEFAULT_THEME
);
}
},