|
|
|
@ -36,22 +36,24 @@ export default Component.extend({
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
setMode: function (mode) {
|
|
|
|
|
let options = {
|
|
|
|
|
...DEFAULTS,
|
|
|
|
|
mode: mode.mime,
|
|
|
|
|
readOnly: this.readonly,
|
|
|
|
|
};
|
|
|
|
|
if (mode.name === 'XML') {
|
|
|
|
|
options.htmlMode = mode.htmlMode;
|
|
|
|
|
options.matchClosing = mode.matchClosing;
|
|
|
|
|
options.alignCDATA = mode.alignCDATA;
|
|
|
|
|
}
|
|
|
|
|
set(this, 'options', options);
|
|
|
|
|
if (!this.isDestroying && !this.isDestroyed) {
|
|
|
|
|
let options = {
|
|
|
|
|
...DEFAULTS,
|
|
|
|
|
mode: mode.mime,
|
|
|
|
|
readOnly: this.readonly,
|
|
|
|
|
};
|
|
|
|
|
if (mode.name === 'XML') {
|
|
|
|
|
options.htmlMode = mode.htmlMode;
|
|
|
|
|
options.matchClosing = mode.matchClosing;
|
|
|
|
|
options.alignCDATA = mode.alignCDATA;
|
|
|
|
|
}
|
|
|
|
|
set(this, 'options', options);
|
|
|
|
|
|
|
|
|
|
const editor = this.editor;
|
|
|
|
|
editor.setOption('mode', mode.mime);
|
|
|
|
|
this.helper.lint(editor, mode.mode);
|
|
|
|
|
set(this, 'mode', mode);
|
|
|
|
|
const editor = this.editor;
|
|
|
|
|
editor.setOption('mode', mode.mime);
|
|
|
|
|
this.helper.lint(editor, mode.mode);
|
|
|
|
|
set(this, 'mode', mode);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
willDestroyElement: function () {
|
|
|
|
|
this._super(...arguments);
|
|
|
|
|