sort: support non-integer comparisons on table sorter
parent
5833a12543
commit
e44746f0da
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue