Integer comparison when available

This commit is contained in:
fbsanchez 2020-05-29 11:22:47 +02:00
parent f7ca97f7ef
commit d8613131bd
1 changed files with 2 additions and 0 deletions

View File

@ -120,6 +120,8 @@ function reloadContent(id, url, options, side, noneStr) {
let items = Object.entries(data).sort(function(a, b) {
if (a[1] == b[1]) return 0;
if (parseInt(a[1]) != 0 && parseInt(b[1]) != 0)
return parseInt(a[1]) > parseInt(b[1]) ? 1 : -1;
return a[1] > b[1] ? 1 : -1;
});