提交 6708ce25 编写于 作者: J Jacob Schatz

Fix editor not working.

上级 1530b1e6
......@@ -15,7 +15,7 @@ const RepoEditor = {
const monacoInstance = this.monaco.editor.create(this.$el, {
model: null,
readOnly: true,
readOnly: false,
contextmenu: false,
});
......
......@@ -3,6 +3,22 @@ import RepoStore from '../stores/repo_store';
export default {
data: () => RepoStore,
computed: {
html() {
return this.activeFile.html;
}
},
watch: {
html() {
this.$nextTick(() => {
$(this.$el).find('.file-content').syntaxHighlight();
});
}
}
}
</script>
......
......@@ -160,8 +160,6 @@ const RepoHelper = {
Store.binaryMimeType = data.mime_type;
// file might be undefined
RepoHelper.setBinaryDataAsBase64(data);
const rawUrl = RepoHelper.getRawURLFromBlobURL(file.url || Service.url);
RepoHelper.setBinaryDataAsBase64(rawUrl, data);
Store.setViewToPreview();
} else if (!Store.isPreviewView()) {
Service.getRaw(data.raw_path)
......@@ -189,7 +187,10 @@ const RepoHelper = {
Store.addFilesToDirectory(file, Store.files, newDirectory);
Store.prevURL = Service.blobURLtoParentTree(Service.url);
}
}).catch(RepoHelper.loadingError);
}).catch((e) => {
console.log(e)
RepoHelper.loadingError()
});
},
setFile(data, file) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册