diff options
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r-- | server/sonar-web/src/main/js/components/navigator/facets/base-facet.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/components/navigator/facets/base-facet.js b/server/sonar-web/src/main/js/components/navigator/facets/base-facet.js index 2b9f573f343..31d78fe36d9 100644 --- a/server/sonar-web/src/main/js/components/navigator/facets/base-facet.js +++ b/server/sonar-web/src/main/js/components/navigator/facets/base-facet.js @@ -95,8 +95,19 @@ define(function () { }, sortValues: function (values) { - return _.sortBy(values, function (v) { - return -v.count; + return values.slice().sort(function (left, right) { + if (left.count !== right.count) { + return right.count - left.count; + } + if (left.val !== right.val) { + if (left.val > right.val) { + return 1; + } + if (left.val < right.val) { + return -1; + } + } + return 0; }); }, |