Commit aaa7dbb4 authored by Phil Hughes's avatar Phil Hughes

fixed alignment with icons

fixed icon not showing correctly in tab
parent 28cda3eb
...@@ -34,11 +34,11 @@ export default { ...@@ -34,11 +34,11 @@ export default {
const type = this.file.tempFile ? 'addition' : 'modification'; const type = this.file.tempFile ? 'addition' : 'modification';
if (this.file.changed && !this.file.staged) { if (this.file.changed && !this.file.staged) {
return `unstaged ${type}`; return `Unstaged ${type}`;
} else if (!this.file.changed && this.file.staged) { } else if (!this.file.changed && this.file.staged) {
return `staged ${type}`; return `Staged ${type}`;
} else if (this.file.changed && this.file.staged) { } else if (this.file.changed && this.file.staged) {
return `unstaged and staged ${pluralize(type)}`; return `Unstaged and staged ${pluralize(type)}`;
} }
return undefined; return undefined;
......
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import fileIcon from '~/vue_shared/components/file_icon.vue'; import fileIcon from '~/vue_shared/components/file_icon.vue';
import icon from '~/vue_shared/components/icon.vue'; import icon from '~/vue_shared/components/icon.vue';
import fileStatusIcon from './repo_file_status_icon.vue'; import fileStatusIcon from './repo_file_status_icon.vue';
import changedFileIcon from './changed_file_icon.vue'; import changedFileIcon from './changed_file_icon.vue';
export default { export default {
components: { components: {
fileStatusIcon, fileStatusIcon,
fileIcon, fileIcon,
icon, icon,
changedFileIcon, changedFileIcon,
},
props: {
tab: {
type: Object,
required: true,
}, },
props: { },
tab: { data() {
type: Object, return {
required: true, tabMouseOver: false,
}, };
},
computed: {
closeLabel() {
if (this.fileHasChanged) {
return `${this.tab.name} changed`;
}
return `Close ${this.tab.name}`;
}, },
data() { showChangedIcon() {
return { return this.fileHasChanged ? !this.tabMouseOver : false;
tabMouseOver: false,
};
}, },
computed: { fileHasChanged() {
closeLabel() { return this.tab.changed || this.tab.tempFile || this.tab.staged;
if (this.tab.changed || this.tab.tempFile) {
return `${this.tab.name} changed`;
}
return `Close ${this.tab.name}`;
},
showChangedIcon() {
return this.tab.changed ? !this.tabMouseOver : false;
},
}, },
},
methods: { methods: {
...mapActions([ ...mapActions(['closeFile']),
'closeFile', clickFile(tab) {
]), this.$router.push(`/project${tab.url}`);
clickFile(tab) {
this.$router.push(`/project${tab.url}`);
},
mouseOverTab() {
if (this.tab.changed) {
this.tabMouseOver = true;
}
},
mouseOutTab() {
if (this.tab.changed) {
this.tabMouseOver = false;
}
},
}, },
}; mouseOverTab() {
if (this.fileHasChanged) {
this.tabMouseOver = true;
}
},
mouseOutTab() {
if (this.fileHasChanged) {
this.tabMouseOver = false;
}
},
},
};
</script> </script>
<template> <template>
......
...@@ -498,6 +498,7 @@ ...@@ -498,6 +498,7 @@
.multi-file-commit-panel-header-title { .multi-file-commit-panel-header-title {
display: flex; display: flex;
flex: 1; flex: 1;
padding-left: $grid-size;
svg { svg {
margin-right: $gl-btn-padding; margin-right: $gl-btn-padding;
...@@ -770,6 +771,7 @@ ...@@ -770,6 +771,7 @@
&:not(.is-collapsed) { &:not(.is-collapsed) {
flex: 1; flex: 1;
min-height: 140px;
} }
} }
......
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