diff options
author | Jacob Schatz <jschatz1@gmail.com> | 2017-08-06 18:47:33 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz1@gmail.com> | 2017-08-06 18:47:33 +0300 |
commit | 33c058e3d7e6bc426dd06e885d64a73d162b2998 (patch) | |
tree | 558949ff464ae431239c495f99fe7a8d64308c5e /app/assets | |
parent | c087e4395ee138268e5c90c85aae231b954c6e3f (diff) |
Can show file as computed property.
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/repo/components/repo_file.vue | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/repo/components/repo_file.vue b/app/assets/javascripts/repo/components/repo_file.vue index bd57c33af6a..f604bc22a26 100644 --- a/app/assets/javascripts/repo/components/repo_file.vue +++ b/app/assets/javascripts/repo/components/repo_file.vue @@ -29,6 +29,12 @@ const RepoFile = { }, }, + computed: { + canShowFile() { + return !this.loading.tree || this.hasFiles; + }, + }, + methods: { linkClicked(file) { this.$emit('linkclicked', file); @@ -40,7 +46,7 @@ export default RepoFile; </script> <template> -<tr class="file" v-if="!loading.tree || hasFiles" :class="{'active': activeFile.url === file.url}"> +<tr class="file" v-if="canShowFile" :class="{'active': activeFile.url === file.url}"> <td @click.prevent="linkClicked(file)"> <i class="fa file-icon" v-if="!file.loading" :class="file.icon" :style="{'margin-left': file.level * 10 + 'px'}"></i> <i class="fa fa-spinner fa-spin" v-if="file.loading" :style="{'margin-left': file.level * 10 + 'px'}"></i> |