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:
parent
b316ba80d8
commit
5fe094a2d7
2 changed files with 7 additions and 7 deletions
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue