aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/coffee/dashboard/models/widget.coffee
blob: 6665b537821252753c44ba3dc3e89c33f127897f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
define ['backbone'], (Backbone) ->


  class extends Backbone.Model
    idAttribute: 'key'


    mergeProperties: (properties) ->
      props = @get 'properties'
      props = properties.map (prop) ->
        data = _.findWhere props, key: prop.key
        _.extend prop, data
      @set 'properties', props