Skip to content

Commit

Permalink
Update table-sort.js
Browse files Browse the repository at this point in the history
  • Loading branch information
alijsh authored Dec 21, 2023
1 parent 24e8471 commit 313e6a8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions public/table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
const [getTagTable] = getHTMLTables();
const columnIndexAndTableRow = {};
for (let table of getTagTable) {
if (table.classList.contains("table-sort")) {
if (table.classList.contains("table-sort") && !table.classList.contains("table-processed")) {
makeTableSortable(table);
}
}
Expand Down Expand Up @@ -113,12 +113,8 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
}
}

function makeTableSortable(sortableTable) {
if (sortableTable.classList.contains("table-processed")) {
return;
} else {
sortableTable.classList.add("table-processed");
}
function makeTableSortable(sortableTable) {
sortableTable.classList.add("table-processed");
const table = {
bodies: getTableBodies(sortableTable),
theads: sortableTable.querySelectorAll("thead"),
Expand Down

0 comments on commit 313e6a8

Please sign in to comment.