aboutsummaryrefslogtreecommitdiff
path: root/src/components/extra_buttons/extra_buttons.vue
blob: 8e24e9a53051bda4adea8cc90c77357432643261 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
  <Popper
    v-if="enabled && showPopper"
    trigger="click"
    append-to-body
    :options="{
      placement: 'top',
      modifiers: {
        arrow: { enabled: true },
        offset: { offset: '0, 5px' },
      }
    }"
    @hide="showDropDown = false"
  >
    <div class="popper-wrapper">
      <div class="dropdown-menu">
        <button
          v-if="!status.pinned && canPin"
          class="dropdown-item dropdown-item-icon"
          @click.prevent="pinStatus"
        >
          <i class="icon-pin" /><span>{{ $t("status.pin") }}</span>
        </button>
        <button
          v-if="status.pinned && canPin"
          class="dropdown-item dropdown-item-icon"
          @click.prevent="unpinStatus"
        >
          <i class="icon-pin" /><span>{{ $t("status.unpin") }}</span>
        </button>
        <button
          v-if="canDelete"
          class="dropdown-item dropdown-item-icon"
          @click.prevent="deleteStatus"
        >
          <i class="icon-cancel" /><span>{{ $t("status.delete") }}</span>
        </button>
      </div>
    </div>
    <div
      slot="reference"
      class="button-icon"
      @click="toggleMenu"
    >
      <i
        class="icon-ellipsis"
        :class="{'icon-clicked': showDropDown}"
      />
    </div>
  </Popper>
</template>

<script src="./extra_buttons.js" ></script>

<style lang="scss">
@import '../../_variables.scss';
@import '../popper/popper.scss';

.icon-ellipsis {
  cursor: pointer;

  &:hover, &.icon-clicked {
    color: $fallback--text;
    color: var(--text, $fallback--text);
  }
}
</style>