1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-25 08:09:43 +02:00

Save CodeMirror editor instance at end of process

This commit is contained in:
Harvey Kandola 2018-06-07 19:14:09 +01:00
parent b316ba80d8
commit 5fe094a2d7
2 changed files with 7 additions and 7 deletions

View file

@ -83,13 +83,13 @@ export default Component.extend(TooltipMixin, {
Mousetrap.trigger('ctrl+s');
};
this.set('codeEditor', editor);
let syntax = this.get("codeSyntax");
if (is.not.undefined(syntax)) {
CodeMirror.autoLoadMode(editor, syntax.mode);
editor.setOption("mode", syntax.mode);
}
this.set('codeEditor', editor);
},
willDestroyElement() {

View file

@ -17,7 +17,7 @@ export default Component.extend({
didReceiveAttrs() {
this._super(...arguments);
if (this.get('isDestroyed') || this.get('isDestroying')) {
return;
}
@ -43,7 +43,7 @@ export default Component.extend({
didInsertElement() {
this._super(...arguments);
if (this.get('isDestroyed') || this.get('isDestroying')) {
return;
}
@ -62,14 +62,14 @@ export default Component.extend({
readOnly: true
});
this.set('codeEditor', editor);
let syntax = this.get("codeSyntax");
if (is.not.undefined(syntax)) {
CodeMirror.autoLoadMode(editor, syntax.mode);
editor.setOption("mode", syntax.mode);
}
},
this.set('codeEditor', editor);
},
willDestroyElement() {
this._super(...arguments);