table sort: ignore going to a in td if already has custom sort key

pull/15/head
justcool393 2022-11-26 09:58:59 -06:00
parent 883fbfc13b
commit 5833a12543
1 changed files with 3 additions and 1 deletions

View File

@ -7,7 +7,9 @@ function sort_table(n) {
for (let i = 1; i < rows.length; i++) {
const ele = rows[i];
let x = rows[i].getElementsByTagName("TD")[n];
x = x.getElementsByTagName('a')[0] || x;
if (!('sortKey' in x.dataset)) {
x = x.getElementsByTagName('a')[0] || x;
}
var attr;
if ('sortKey' in x.dataset) {
attr = x.dataset.sortKey;