aboutsummaryrefslogtreecommitdiff
path: root/src/components/status_popover/status_popover.js
blob: 19f16bd980d8c5144b7497ea88a3d68cfde2e0ca (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
import { find } from 'lodash'

const StatusPopover = {
  name: 'StatusPopover',
  props: [
    'statusId'
  ],
  data () {
    return {
      popperOptions: {
        modifiers: {
          preventOverflow: { padding: { top: 50 }, boundariesElement: 'viewport' }
        }
      }
    }
  },
  computed: {
    status () {
      return find(this.$store.state.statuses.allStatuses, { id: this.statusId })
    }
  },
  components: {
    Status: () => import('../status/status.vue')
  },
  methods: {
    enter () {
      if (!this.status) {
        this.$store.dispatch('fetchStatus', this.statusId)
      }
    }
  }
}

export default StatusPopover