forked from rDrama/rDrama
table sorting: mitigate chrome bug
parent
e329746bec
commit
6b3fa2f918
|
@ -21,10 +21,10 @@ function sort_table(n) {
|
||||||
items.push({ ele, attr });
|
items.push({ ele, attr });
|
||||||
}
|
}
|
||||||
if (sortAscending[n]) {
|
if (sortAscending[n]) {
|
||||||
items.sort((a, b) => a.attr > b.attr);
|
items.sort((a, b) => a.attr > b.attr ? 1 : -1);
|
||||||
sortAscending[n] = false;
|
sortAscending[n] = false;
|
||||||
} else {
|
} else {
|
||||||
items.sort((a, b) => a.attr < b.attr);
|
items.sort((a, b) => a.attr < b.attr ? 1 : -1);
|
||||||
sortAscending[n] = true;
|
sortAscending[n] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue