Commit 6708ce25 authored by Jacob Schatz's avatar Jacob Schatz

Fix editor not working.

parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment