diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/metrics/metrics.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/metrics/metrics.js | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/server/sonar-web/src/main/js/apps/metrics/metrics.js b/server/sonar-web/src/main/js/apps/metrics/metrics.js index 393ebe3c2b1..44fa17c8227 100644 --- a/server/sonar-web/src/main/js/apps/metrics/metrics.js +++ b/server/sonar-web/src/main/js/apps/metrics/metrics.js @@ -1,41 +1,41 @@ -define([ - './metric' -], function (Metric) { - - return Backbone.Collection.extend({ - model: Metric, - - url: function () { - return baseUrl + '/api/metrics/search'; - }, - - parse: function (r) { - this.total = r.total; - this.p = r.p; - this.ps = r.ps; - return r.metrics; - }, - - fetch: function (options) { - var opts = _.defaults(options || {}, { data: {} }); - this.q = opts.data.q; - opts.data.isCustom = true; - return this._super(opts); - }, - - fetchMore: function () { - var p = this.p + 1; - return this.fetch({ add: true, remove: false, data: { p: p, ps: this.ps, q: this.q } }); - }, - - refresh: function () { - return this.fetch({ reset: true, data: { q: this.q } }); - }, - - hasMore: function () { - return this.total > this.p * this.ps; - } - - }); +import _ from 'underscore'; +import Backbone from 'backbone'; +import Metric from './metric'; + +export default Backbone.Collection.extend({ + model: Metric, + + url: function () { + return baseUrl + '/api/metrics/search'; + }, + + parse: function (r) { + this.total = r.total; + this.p = r.p; + this.ps = r.ps; + return r.metrics; + }, + + fetch: function (options) { + var opts = _.defaults(options || {}, { data: {} }); + this.q = opts.data.q; + opts.data.isCustom = true; + return this._super(opts); + }, + + fetchMore: function () { + var p = this.p + 1; + return this.fetch({ add: true, remove: false, data: { p: p, ps: this.ps, q: this.q } }); + }, + + refresh: function () { + return this.fetch({ reset: true, data: { q: this.q } }); + }, + + hasMore: function () { + return this.total > this.p * this.ps; + } }); + + |