gitlab-org--gitlab-foss/app/assets/javascripts/ci_lint_editor.js
2017-03-13 14:41:32 -05:00

17 lines
409 B
JavaScript

window.gl = window.gl || {};
class CILintEditor {
constructor() {
this.editor = window.ace.edit('ci-editor');
this.textarea = document.querySelector('#content');
this.editor.getSession().setMode('ace/mode/yaml');
this.editor.on('input', () => {
const content = this.editor.getSession().getValue();
this.textarea.value = content;
});
}
}
gl.CILintEditor = CILintEditor;