Fix analysis sorting

Return value of the sort compare function is defined as value less, equal or greater than 0, not as boolean.
This commit is contained in:
Norbert Renner 2020-06-12 10:57:41 +02:00
parent eb0e0d6f1e
commit 71317b84e4

View file

@ -190,7 +190,7 @@ BR.TrackAnalysis = L.Class.extend({
} }
analysisSortable[type].sort(function(a, b) { 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++) { for (var j = 0; j < analysisSortable[type].length; j++) {