Skip to content

Commit

Permalink
Fix analysis sorting
Browse files Browse the repository at this point in the history
Return value of the sort compare function is defined as value less, equal or greater than 0, not as boolean.
  • Loading branch information
nrenner committed Jun 12, 2020
1 parent eb0e0d6 commit 71317b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/control/TrackAnalysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ BR.TrackAnalysis = L.Class.extend({
}

analysisSortable[type].sort(function(a, b) {
return a.distance < b.distance;
return b.distance - a.distance;
});

for (var j = 0; j < analysisSortable[type].length; j++) {
Expand Down

0 comments on commit 71317b8

Please sign in to comment.