BigW Consortium Gitlab

Remove panel-right query and replace with state value

parent 76ff3dfd
...@@ -29,7 +29,7 @@ function initRepo() { ...@@ -29,7 +29,7 @@ function initRepo() {
data: () => Store, data: () => Store,
template: ` template: `
<div class="tree-content-holder"> <div class="tree-content-holder">
<repo-sidebar/><div class="panel-right"> <repo-sidebar/><div class="panel-right" :class="{'edit-mode': readOnly}">
<repo-tabs/> <repo-tabs/>
<repo-file-buttons/> <repo-file-buttons/>
<repo-editor/> <repo-editor/>
......
...@@ -66,15 +66,9 @@ const RepoEditor = { ...@@ -66,15 +66,9 @@ const RepoEditor = {
}, },
editMode() { editMode() {
const panelClassList = document.querySelector('.panel-right').classList; const readOnly = !this.editMode;
let readOnly = false;
if (this.editMode) { Store.readOnly = readOnly;
panelClassList.add('edit-mode');
} else {
panelClassList.remove('edit-mode');
readOnly = true;
}
this.monacoInstance.updateOptions({ this.monacoInstance.updateOptions({
readOnly, readOnly,
......
...@@ -59,6 +59,7 @@ const RepoStore = { ...@@ -59,6 +59,7 @@ const RepoStore = {
tree: false, tree: false,
blob: false, blob: false,
}, },
readOnly: true,
// mutations // mutations
......
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