aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/issue/views/transitions-form-view.js
blob: 773db9fe2d0d497a981cddce05707722aa2e51e8 (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
define([
  'components/common/action-options-view',
  '../templates'
], function (ActionOptionsView) {

  var $ = jQuery;

  return ActionOptionsView.extend({
    template: Templates['issue-transitions-form'],

    selectInitialOption: function () {
      this.makeActive(this.getOptions().first());
    },

    selectOption: function (e) {
      var transition = $(e.currentTarget).data('value');
      this.submit(transition);
      return ActionOptionsView.prototype.selectOption.apply(this, arguments);
    },

    submit: function (transition) {
      return this.model.transition(transition);
    }
  });

});