Commit 62303530 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Move repoEditorLoader to index and change repo_editor to vue comp

parent 6f88402f
......@@ -9,10 +9,21 @@ import RepoCommitSection from './repo_commit_section.vue';
import RepoTabs from './repo_tabs.vue';
import RepoFileButtons from './repo_file_buttons.vue';
import RepoBinaryViewer from './repo_binary_viewer.vue';
import { repoEditorLoader } from './repo_editor';
import RepoEditor from './repo_editor.vue';
import monacoLoader from './monaco_loader';
import RepoMixin from './repo_mixin';
import PopupDialog from '../vue_shared/components/popup_dialog.vue'
function repoEditorLoader() {
return new Promise((resolve) => {
monacoLoader(['vs/editor/editor.main'], () => {
Store.monaco = monaco;
resolve(RepoEditor);
});
});
}
function addEventsForNonVueEls() {
$(document).on('change', '.dropdown', () => {
Store.targetBranch = $('.project-refs-target-form input[name="ref"]').val();
......
<script>
/* global monaco */
import Store from './repo_store';
import Helper from './repo_helper';
import monacoLoader from './monaco_loader';
const RepoEditor = {
data: () => Store,
template: '<div id="ide"></div>',
mounted() {
const monacoInstance = this.monaco.editor.create(this.$el, {
model: null,
......@@ -106,17 +104,9 @@ const RepoEditor = {
},
};
function repoEditorLoader() {
return new Promise((resolve) => {
monacoLoader(['vs/editor/editor.main'], () => {
Store.monaco = monaco;
resolve(RepoEditor);
});
});
}
export default RepoEditor;
</script>
export {
RepoEditor as default,
repoEditorLoader,
};
<template>
<div id="ide"></div>
</template>
import Vue from 'vue';
import repoEditor from '~/repo/repo_editor';
import repoEditor from '~/repo/repo_editor.vue';
import RepoStore from '~/repo/repo_store';
describe('RepoEditor', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment