summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/components/repo_file.vue
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-05-02 15:05:15 +0100
committerPhil Hughes <me@iamphill.com>2018-05-02 15:05:15 +0100
commitb91d400ee0c1fc10f20f9f1e909b01d0a4082ed4 (patch)
treebdb840458429a142b8a9dd784c52502f5a4f5932 /app/assets/javascripts/ide/components/repo_file.vue
parentb8bda4ce109db177bbea798bb5837e38e0ff31a0 (diff)
downloadgitlab-ce-b91d400ee0c1fc10f20f9f1e909b01d0a4082ed4.tar.gz
created computed props
removed unused parameters
Diffstat (limited to 'app/assets/javascripts/ide/components/repo_file.vue')
-rw-r--r--app/assets/javascripts/ide/components/repo_file.vue10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/ide/components/repo_file.vue b/app/assets/javascripts/ide/components/repo_file.vue
index 63ca8c3ab89..89c5ce70dd3 100644
--- a/app/assets/javascripts/ide/components/repo_file.vue
+++ b/app/assets/javascripts/ide/components/repo_file.vue
@@ -83,6 +83,12 @@ export default {
'is-open': this.file.opened,
};
},
+ showTreeChangesCount() {
+ return this.isTree && this.changesCount > 0 && !this.file.opened;
+ },
+ showChangedFileIcon() {
+ return this.file.changed || this.file.tempFile || this.file.staged;
+ },
},
updated() {
if (this.file.type === 'blob' && this.file.active) {
@@ -140,7 +146,7 @@ export default {
v-if="file.mrChange"
/>
<span
- v-if="isTree && changesCount > 0 && !file.opened"
+ v-if="showTreeChangesCount"
class="ide-tree-changes"
>
{{ changesCount }}
@@ -155,7 +161,7 @@ export default {
/>
</span>
<changed-file-icon
- v-else-if="file.changed || file.tempFile || file.staged"
+ v-else-if="showChangedFileIcon"
:file="file"
:show-tooltip="true"
:show-staged-icon="true"