summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/line_comments/components/line_btn.js.coffee
blob: 3abcd41df1eb34a2d86e2c68c814b9223a066e65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
LineBtn = Vue.extend
  props:
    noteId: Number
    resolved: Boolean
  computed:
    buttonText: ->
      if this.resolved then "Mark as un-resolved" else "Mark as resolved"
  methods:
    updateTooltip: ->
      $(this.$el)
        .tooltip('hide')
        .tooltip('fixTitle')
    resolve: ->
      this.$set('resolved', !this.resolved)
      this.$nextTick this.updateTooltip
  compiled: ->
    $(this.$el).tooltip()

Vue.component 'line-btn', LineBtn