aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/computation/search-view.js
blob: 1e896df0c16af225a4fbb13c975054ed9ca84271 (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 _ from 'underscore';
import Marionette from 'backbone.marionette';
import './templates';

export default Marionette.ItemView.extend({
  template: Templates['computation-search'],

  collectionEvents: {
    'all': 'render'
  },

  events: {
    'click .js-queue': 'queue',
    'click .js-history': 'history'
  },

  queue: function (e) {
    e.preventDefault();
    this.options.router.navigate('current', { trigger: true });
  },

  history: function (e) {
    e.preventDefault();
    this.options.router.navigate('past', { trigger: true });
  },

  serializeData: function () {
    return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
      tab: this.collection.q
    });
  }
});