summaryrefslogtreecommitdiff
path: root/src/views/_sila/SILA/RAID/Settings/OptionsPopover.vue
blob: d1b857545c1b82bc918ae86d4f244a8b55ac451b (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
  <b-popover
    placement="left"
    triggers="focus"
    :show.sync="show"
    custom-class="popover-heigth-100"
    :target="`popover-option-${id}`"
  >
    <b-button
      id="popover-option-button"
      variant="popover"
      @click="
        () => {
          show = false;
          openModal();
        }
      "
    >
      <img
        src="@/assets/images/icon-settings-red.svg"
        class="icon-chevron icon-settings"
      />
      Настройки
    </b-button>
    <b-button
      id="popover-option-button"
      class="delete"
      variant="popover"
      @click="show = false"
    >
      <img
        src="@/assets/images/icon-clear-red.svg"
        class="icon-chevron icon-delete"
      />
      Удалить
    </b-button>
  </b-popover>
</template>

<script>
export default {
  props: {
    id: {
      type: Number,
      default: null,
    },
  },
  data() {
    return {
      show: false,
    };
  },
  methods: {
    openModal() {
      this.$bvModal.show(`edit-tome${this.id}`);
    },
  },
};
</script>
<style lang="scss" scoped>
.popover-heigth-100 {
  max-width: 120px;
}

#popover-option-button {
  padding: 0 9px 0 10px;
  font-size: 12px;
  &:hover {
    color: $red-brand-primary;
    box-shadow: 1px 2px 4px -1px rgb(79 37 37 / 25%) inset;
  }
  &:active {
    box-shadow: 1px 2px 4px -1px rgb(79 37 37 / 50%) inset;
  }
  &.delete {
    padding: 0 26px 0 13px;
  }
}

.icon-settings {
  padding-right: 5px;
}

.icon-delete {
  padding-right: 10px;
}
</style>