Commit d52172fa authored by Jacob Schatz's avatar Jacob Schatz

Adds green to circle when unsaved. Activates right tab when closing.

parent 0cdf9700
......@@ -30,7 +30,7 @@ function initRepo() {
data: () => Store,
template: `
<div class="tree-content-holder">
<repo-sidebar/><div class="panel-right" :class="{'edit-mode': readOnly}">
<repo-sidebar/><div class="panel-right" :class="{'edit-mode': editMode}">
<repo-tabs/>
<repo-file-buttons/>
<repo-editor/>
......
......@@ -13,12 +13,10 @@ const RepoBinaryViewer = {
methods: {
errored() {
console.log('errored');
Store.binaryLoaded = false;
},
loaded() {
console.log('loaded');
Store.binaryLoaded = true;
},
......@@ -39,7 +37,6 @@ const RepoBinaryViewer = {
if (!this.binary) return;
switch (this.binaryMimeType) {
case 'image/png':
console.log('png bitch')
this.binaryTypes.png = true;
break;
default:
......
......@@ -65,6 +65,7 @@ const RepoEditor = {
},
editMode() {
console.log('edit mode changed')
const readOnly = !this.editMode;
Store.readOnly = readOnly;
......
......@@ -151,8 +151,25 @@ const RepoStore = {
removeFromOpenedFiles(file) {
if (file.type === 'tree') return;
let foundIndex;
RepoStore.openedFiles = RepoStore.openedFiles.filter((openedFile, i) => {
if(openedFile.url === file.url) foundIndex = i;
return openedFile.url !== file.url;
});
// now activate the right tab based on what you closed.
if(RepoStore.openedFiles.length === 0) return;
if(RepoStore.openedFiles.length === 1 || foundIndex === 0) {
RepoStore.setActiveFiles(RepoStore.openedFiles[0]);
return;
}
RepoStore.openedFiles = RepoStore.openedFiles.filter(openedFile => openedFile.url !== file.url);
if(foundIndex) {
if(foundIndex > 0) {
RepoStore.setActiveFiles(RepoStore.openedFiles[foundIndex - 1]);
}
}
},
addPlaceholderFile() {
......
......@@ -100,6 +100,7 @@
&.close {
width: auto;
font-size: 15px;
opacity: 1;
}
}
......@@ -110,6 +111,10 @@
margin-left: 15px;
color: $gray-darkest;
}
i.fa.fa-circle {
color: $brand-success;
}
}
}
......
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