aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/coffee/component-viewer/time-changes-popup.coffee
blob: 0854f1b91e653917c4923f450be196ed13e58e05 (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
define [
  'backbone.marionette'
  'templates/component-viewer'
  'common/popup'
], (
  Marionette
  Templates
  Popup
) ->

  $ = jQuery


  class TimeChangesPopupView extends Popup
    template: Templates['time-changes-popup']


    events:
      'click a[data-period]': 'enablePeriod'


    enablePeriod: (e) ->
      period = $(e.currentTarget).data 'period'
      @trigger 'change', period


    serializeData: ->
      component: @options.main.component.toJSON()
      periods: @options.main.periods.toJSON()
      prefix: @options.prefix || 'Δ'