summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/boards/components/board_delete.js
blob: 5caa7b4c146a64eed9157b852704ab7cd60e9a5e (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
/* eslint-disable no-alert */
export default {
  props: {
    list: {
      type: Object,
      required: true,
    },
  },
  methods: {
    deleteBoard() {
      $(this.$el).tooltip('hide');

      if (confirm('Are you sure you want to delete this list?')) {
        this.list.destroy();
      }
    },
  },
  template: `
    <button
      class="board-delete has-tooltip pull-right"
      type="button"
      title="Delete list"
      aria-label="Delete list"
      data-placement="bottom"
      @click.stop="deleteBoard">
      <i
        class="fa fa-trash"
        ara-hidden="true">
      </i>
    </button>
  `,
};