diff options
author | Phil Hughes <me@iamphill.com> | 2017-11-28 19:51:37 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-11-28 19:51:37 +0300 |
commit | d22bb0397b04f2870c6fbbeb2912ef6627e4afb7 (patch) | |
tree | 4ac97a97232823b10029e59b4ff124299978a062 /app/assets | |
parent | 5fceb8d1ecb8b3b682ad0cc73a26b99068864f3f (diff) |
fixed failing specs
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/repo/components/repo_editor.vue | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/assets/javascripts/repo/components/repo_editor.vue b/app/assets/javascripts/repo/components/repo_editor.vue index f0fc0031e35..f37cbd1e961 100644 --- a/app/assets/javascripts/repo/components/repo_editor.vue +++ b/app/assets/javascripts/repo/components/repo_editor.vue @@ -6,11 +6,11 @@ import monacoLoader from '../monaco_loader'; import Editor from '../lib/editor'; export default { - destroyed() { + beforeDestroy() { this.editor.dispose(); }, mounted() { - if (this.monaco) { + if (this.editor && monaco) { this.initMonaco(); } else { monacoLoader(['vs/editor/editor.main'], () => { @@ -32,7 +32,7 @@ export default { this.getRawFileData(this.activeFile) .then(() => { - this.editor.createInstance(this.$el); + this.editor.createInstance(this.$refs.editor); }) .then(() => this.setupEditor()) .catch(() => flash('Error setting up monaco. Please try again.')); @@ -76,9 +76,14 @@ export default { class="blob-viewer-container blob-editor-container" > <div - v-if="shouldHideEditor" + v-show="shouldHideEditor" v-html="activeFile.html" > </div> + <div + v-show="!shouldHideEditor" + ref="editor" + > + </div> </div> </template> |