summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2013-12-06 11:43:55 +0600
committerStas Vilchik <vilchiks@gmail.com>2013-12-06 11:43:55 +0600
commit451625c12e9d38b66faeebb26ddc31c44033d7e9 (patch)
tree7ff103d8a5afcd092473ac04e699ca6c315d2bc9
parent1bf72293130a05337aee3ad0656c7efebe0e0b4b (diff)
downloadsonarqube-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.erb6
-rw-r--r--sonar-server/src/main/webapp/javascripts/navigator/filters/favorite-filters.js15
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
+ });
}
});