summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/repo/components/repo_prev_directory.vue
blob: a2b305bbd05baf220afdb978353036b25f05a1b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script>
  import { mapGetters, mapState, mapActions } from 'vuex';

  export default {
    computed: {
      ...mapState([
        'parentTreeUrl',
      ]),
      ...mapGetters([
        'isCollapsed',
      ]),
      colSpanCondition() {
        return this.isCollapsed ? undefined : 3;
      },
    },
    methods: {
      ...mapActions([
        'getTreeData',
      ]),
    },
  };
</script>

<template>
  <tr class="file prev-directory">
    <td
      :colspan="colSpanCondition"
      class="table-cell"
      @click.prevent="getTreeData({ endpoint: parentTreeUrl })"
    >
      <a :href="parentTreeUrl">...</a>
    </td>
  </tr>
</template>