aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/quality-gates/gates-view.js
blob: 956cc21826a615bcf50c5e28b25ca17eb88810b5 (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
import Marionette from 'backbone.marionette';
import ItemView from './gate-view';
import './templates';

export default Marionette.CompositeView.extend({
  className: 'list-group',
  template: Templates['quality-gates-gates'],
  childView: ItemView,
  childViewContainer: '.js-list',

  childViewOptions: function (model) {
    return {
      collectionView: this,
      highlighted: model.id === this.highlighted
    };
  },

  highlight: function (id) {
    this.highlighted = id;
    this.render();
  }
});