fixed alignment with icons

fixed icon not showing correctly in tab
This commit is contained in:
Phil Hughes 2018-03-29 14:52:40 +01:00
parent 28cda3ebe8
commit aaa7dbb4b6
No known key found for this signature in database
GPG Key ID: 32245528C52E0F9F
3 changed files with 54 additions and 51 deletions

View File

@ -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;

View File

@ -1,60 +1,61 @@
<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>

View File

@ -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;
}
}