Skip to content

Commit

Permalink
fix: reset css editor
Browse files Browse the repository at this point in the history
  • Loading branch information
bouc615 committed Dec 11, 2019
1 parent d253c75 commit 2055615
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions assets/scripts/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,11 @@ let app = new Vue({
type: 'warning',
center: true
}).then(() => {
localStorage.removeItem('__editor_content');
localStorage.removeItem('__css_content');
localStorage.clear()
this.setDefaultContent();
this.cssEditor.setValue(DEFAULT_CSS_CONTENT);
this.editor.focus();
this.refresh();
this.cssChanged()
}).catch(() => {
this.editor.focus();
});
Expand All @@ -220,8 +219,12 @@ let app = new Vue({
localStorage.removeItem(name);
}
},
customStyle() {
async customStyle() {
this.showBox = !this.showBox;
let flag = await localStorage.getItem("__css_content")
if (!flag) {
this.cssEditor.setValue(DEFAULT_CSS_CONTENT);
}
},
setDefaultContent() {
axios({
Expand Down

0 comments on commit 2055615

Please sign in to comment.