diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2013-12-06 11:43:55 +0600 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2013-12-06 11:43:55 +0600 |
commit | 451625c12e9d38b66faeebb26ddc31c44033d7e9 (patch) | |
tree | 7ff103d8a5afcd092473ac04e699ca6c315d2bc9 | |
parent | 1bf72293130a05337aee3ad0656c7efebe0e0b4b (diff) | |
download | sonarqube-451625c12e9d38b66faeebb26ddc31c44033d7e9.tar.gz sonarqube-451625c12e9d38b66faeebb26ddc31c44033d7e9.zip |
Issues and Measures: order filters
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/navigator/_filter_templates.html.erb | 6 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/javascripts/navigator/filters/favorite-filters.js | 15 |
2 files changed, 18 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/navigator/_filter_templates.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/navigator/_filter_templates.html.erb index 5db4bb73e9a..bb56898e87b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/navigator/_filter_templates.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/navigator/_filter_templates.html.erb @@ -103,10 +103,10 @@ <script id="detailsFavoriteFilterTemplate" type="text/template"> <ul class="navigator-filter-select-list"> - {[ if (_.keys(choices).length > 0) { ]} - {[ _.each(choices, function(value, key) { ]} + {[ if (choicesArray.length > 0) { ]} + {[ _.each(choicesArray, function(f) { ]} <li> - <label data-id="{{ key }}">{{ value }}</label> + <label data-id="{{ f.k }}">{{ f.v }}</label> </li> {[ }); ]} <li class="line"></li> diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/favorite-filters.js b/sonar-server/src/main/webapp/javascripts/navigator/filters/favorite-filters.js index e55b847f7d9..39d861b8a2e 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/favorite-filters.js +++ b/sonar-server/src/main/webapp/javascripts/navigator/filters/favorite-filters.js @@ -22,6 +22,21 @@ window.SS = typeof window.SS === 'object' ? window.SS : {}; manage: function() { window.location = baseUrl + this.model.get('manageUrl'); + }, + + + serializeData: function() { + var choices = this.model.get('choices'), + choicesArray = + _.sortBy( + _.map(choices, function (v, k) { + return { v: v, k: k }; + }), + 'v'); + + return _.extend({}, this.model.toJSON(), { + choicesArray: choicesArray + }); } }); |