Skip to content

Commit

Permalink
Decouple thead from tbodies.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeWannacott committed May 29, 2023
1 parent f4038c1 commit 1357aed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,21 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
rows: [],
headers: [],
};
for (let index of table.theads.keys()) {
table.headers.push(table.theads.item(index).querySelectorAll("th"));
}
for (let index of table.bodies.keys()) {
if (table.bodies.item(index) == null) {
return;
}
table.headers.push(table.theads.item(index).querySelectorAll("th"));
table.rows.push(table.bodies.item(index).querySelectorAll("tr"));
}

table.hasClass = {
noClassInfer: sortableTable.classList.contains("no-class-infer"),
cellsSort: sortableTable.classList.contains("cells-sort"),
tableArrows: sortableTable.classList.contains("table-arrows"),
rememberSort: sortableTable.classList.contains("remember-sort"),
};

for (
let headerIndex = 0;
headerIndex < table.theads.length;
Expand Down

0 comments on commit 1357aed

Please sign in to comment.