diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 09:07:45 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 09:07:45 +0000 |
commit | f4186a753b86625a83e8499af14b5badd63a2ac2 (patch) | |
tree | b960dd9f4255e9eee9f87d28e853f163836aa4c5 /app/assets/javascripts/snippet/snippet_bundle.js | |
parent | 0221116862ee66024a03492b4fbbe4e069d84303 (diff) | |
download | gitlab-ce-f4186a753b86625a83e8499af14b5badd63a2ac2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/snippet/snippet_bundle.js')
-rw-r--r-- | app/assets/javascripts/snippet/snippet_bundle.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/assets/javascripts/snippet/snippet_bundle.js b/app/assets/javascripts/snippet/snippet_bundle.js index 42da65a941d..a3ed8d9c632 100644 --- a/app/assets/javascripts/snippet/snippet_bundle.js +++ b/app/assets/javascripts/snippet/snippet_bundle.js @@ -1,14 +1,15 @@ -/* global ace */ -import Editor from '~/editor/editor_lite'; +import { initEditorLite } from '~/blob/utils'; import setupCollapsibleInputs from './collapsible_input'; let editor; const initAce = () => { - editor = ace.edit('editor'); - + const editorEl = document.getElementById('editor'); const form = document.querySelector('.snippet-form-holder form'); const content = document.querySelector('.snippet-file-content'); + + editor = initEditorLite({ el: editorEl }); + form.addEventListener('submit', () => { content.value = editor.getValue(); }); @@ -20,8 +21,7 @@ const initMonaco = () => { const fileNameEl = document.querySelector('.js-snippet-file-name'); const form = document.querySelector('.snippet-form-holder form'); - editor = new Editor(); - editor.createInstance({ + editor = initEditorLite({ el: editorEl, blobPath: fileNameEl.value, blobContent: contentEl.value, |