BigW Consortium Gitlab

tabs.js 1.08 KB
Newer Older
1 2
import Vue from 'vue';

3
const ModalStore = gl.issueBoards.ModalStore;
4

5 6 7 8 9 10 11 12
gl.issueBoards.ModalTabs = Vue.extend({
  mixins: [gl.issueBoards.ModalMixins],
  data() {
    return ModalStore.store;
  },
  computed: {
    selectedCount() {
      return ModalStore.selectedCount();
13
    },
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
  },
  destroyed() {
    this.activeTab = 'all';
  },
  template: `
    <div class="top-area prepend-top-10 append-bottom-10">
      <ul class="nav-links issues-state-filters">
        <li :class="{ 'active': activeTab == 'all' }">
          <a
            href="#"
            role="button"
            @click.prevent="changeTab('all')">
            Open issues
            <span class="badge">
              {{ issuesCount }}
            </span>
          </a>
        </li>
        <li :class="{ 'active': activeTab == 'selected' }">
          <a
            href="#"
            role="button"
            @click.prevent="changeTab('selected')">
            Selected issues
            <span class="badge">
              {{ selectedCount }}
            </span>
          </a>
        </li>
      </ul>
    </div>
  `,
});