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