diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-05-25 14:24:45 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-05-25 14:53:25 +0200 |
commit | 850622c8e811b7465946165352a17f95f90897df (patch) | |
tree | 2dc24b39e82e9715ff6d7c44a3b9a2a1fdfd1cf1 /server/sonar-web/src/main/js/components | |
parent | 55e60bba3b96421c1a2071618343e8211a47b0b7 (diff) | |
download | sonarqube-850622c8e811b7465946165352a17f95f90897df.tar.gz sonarqube-850622c8e811b7465946165352a17f95f90897df.zip |
SONAR-6565 add select list for groups
Diffstat (limited to 'server/sonar-web/src/main/js/components')
-rw-r--r-- | server/sonar-web/src/main/js/components/common/select-list.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/components/common/select-list.js b/server/sonar-web/src/main/js/components/common/select-list.js index d2ca6af8b27..480fbd9d690 100644 --- a/server/sonar-web/src/main/js/components/common/select-list.js +++ b/server/sonar-web/src/main/js/components/common/select-list.js @@ -28,9 +28,12 @@ define(function () { var SelectListCollection = Backbone.Collection.extend({ + initialize: function (options) { + this.options = options; + }, + parse: function (r) { - this.more = r.more; - return r.results; + return this.options.parse.call(this, r); }, fetch: function (options) { @@ -377,7 +380,9 @@ define(function () { window.SelectList = function (options) { this.settings = $.extend(window.SelectList.defaults, options); - this.collection = new SelectListCollection(); + this.collection = new SelectListCollection({ + parse: this.settings.parse + }); this.view = new SelectListView({ el: this.settings.el, @@ -421,6 +426,11 @@ define(function () { return item.value; }, + parse: function (r) { + this.more = r.more; + return r.results; + }, + labels: { selected: 'Selected', deselected: 'Deselected', |