sort: support non-integer comparisons on table sorter

pull/15/head
justcool393 2022-11-26 10:03:30 -06:00
parent 5833a12543
commit e44746f0da
1 changed files with 2 additions and 2 deletions

View File

@ -21,10 +21,10 @@ function sort_table(n) {
items.push({ ele, attr });
}
if (sortAscending[n]) {
items.sort((a, b) => a.attr - b.attr);
items.sort((a, b) => a.attr > b.attr);
sortAscending[n] = false;
} else {
items.sort((a, b) => b.attr - a.attr);
items.sort((a, b) => b.attr < a.attr);
sortAscending[n] = true;
}