aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/navigator/models/facet.js
blob: 94d0fadb8a7d532db9c8ac1a006e4e72e3177726 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
define([
  'backbone'
], function (Backbone) {

  return Backbone.Model.extend({
    idAttribute: 'property',

    defaults: {
      enabled: false
    },

    getValues: function () {
      return this.get('values') || [];
    },

    toggle: function () {
      var enabled = this.get('enabled');
      this.set({ enabled: !enabled });
    }
  });

});