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

Fix editor not working.

parent 1530b1e6
...@@ -15,7 +15,7 @@ const RepoEditor = { ...@@ -15,7 +15,7 @@ const RepoEditor = {
const monacoInstance = this.monaco.editor.create(this.$el, { const monacoInstance = this.monaco.editor.create(this.$el, {
model: null, model: null,
readOnly: true, readOnly: false,
contextmenu: false, contextmenu: false,
}); });
......
...@@ -3,6 +3,22 @@ import RepoStore from '../stores/repo_store'; ...@@ -3,6 +3,22 @@ import RepoStore from '../stores/repo_store';
export default { export default {
data: () => RepoStore, data: () => RepoStore,
computed: {
html() {
return this.activeFile.html;
}
},
watch: {
html() {
this.$nextTick(() => {
$(this.$el).find('.file-content').syntaxHighlight();
});
}
}
} }
</script> </script>
......
...@@ -160,8 +160,6 @@ const RepoHelper = { ...@@ -160,8 +160,6 @@ const RepoHelper = {
Store.binaryMimeType = data.mime_type; Store.binaryMimeType = data.mime_type;
// file might be undefined // file might be undefined
RepoHelper.setBinaryDataAsBase64(data); RepoHelper.setBinaryDataAsBase64(data);
const rawUrl = RepoHelper.getRawURLFromBlobURL(file.url || Service.url);
RepoHelper.setBinaryDataAsBase64(rawUrl, data);
Store.setViewToPreview(); Store.setViewToPreview();
} else if (!Store.isPreviewView()) { } else if (!Store.isPreviewView()) {
Service.getRaw(data.raw_path) Service.getRaw(data.raw_path)
...@@ -189,7 +187,10 @@ const RepoHelper = { ...@@ -189,7 +187,10 @@ const RepoHelper = {
Store.addFilesToDirectory(file, Store.files, newDirectory); Store.addFilesToDirectory(file, Store.files, newDirectory);
Store.prevURL = Service.blobURLtoParentTree(Service.url); Store.prevURL = Service.blobURLtoParentTree(Service.url);
} }
}).catch(RepoHelper.loadingError); }).catch((e) => {
console.log(e)
RepoHelper.loadingError()
});
}, },
setFile(data, file) { 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