Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dropdown_button.vue « labels_select_vue « sidebar « components « vue_shared « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f45c14f8344afab0f9024b2956531850595cfeb1 (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
35
<script>
import { mapActions, mapGetters } from 'vuex';
import { GlButton, GlIcon } from '@gitlab/ui';

export default {
  components: {
    GlButton,
    GlIcon,
  },
  computed: {
    ...mapGetters(['dropdownButtonText', 'isDropdownVariantStandalone']),
  },
  methods: {
    ...mapActions(['toggleDropdownContents']),
    handleButtonClick(e) {
      if (this.isDropdownVariantStandalone) {
        this.toggleDropdownContents();
        e.stopPropagation();
      }
    },
  },
};
</script>

<template>
  <gl-button
    class="labels-select-dropdown-button js-dropdown-button w-100 text-left"
    @click="handleButtonClick"
  >
    <span class="dropdown-toggle-text flex-fill">
      {{ dropdownButtonText }}
    </span>
    <gl-icon name="chevron-down" class="pull-right" />
  </gl-button>
</template>