Skip to content

Commit

Permalink
refactor name from innerOrOuterHTML to cellsOrRows.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeWannacott committed May 22, 2023
1 parent 7e44cfe commit ee0542a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions public/table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
}
}

function innerOrOuterHTML(table, tr) {
function cellsOrRows(table, tr) {
if (table.hasClass.cellsSort) {
return tr.innerHTML;
} else {
Expand All @@ -149,7 +149,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
let dataAttributeTd = column.getColumn(tr, column.spanSum, column.span)
.dataset.sort;
column.toBeSorted.push(`${dataAttributeTd}#${i}`);
columnIndexAndTableRow[column.toBeSorted[i]] = innerOrOuterHTML(table, tr);
columnIndexAndTableRow[column.toBeSorted[i]] = cellsOrRows(table, tr);
}
}

Expand All @@ -174,7 +174,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
let unit = match[2].toLowerCase();
let multiplier = unitToMultiplier[unit];
column.toBeSorted.push(`${number * multiplier}#${i}`);
columnIndexAndTableRow[column.toBeSorted[i]] = innerOrOuterHTML(
columnIndexAndTableRow[column.toBeSorted[i]] = cellsOrRows(
table,
tr
);
Expand Down Expand Up @@ -217,7 +217,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
);
}
column.toBeSorted.push(`${numberToSort}#${i}`);
columnIndexAndTableRow[column.toBeSorted[i]] = innerOrOuterHTML(
columnIndexAndTableRow[column.toBeSorted[i]] = cellsOrRows(
table,
tr
);
Expand Down Expand Up @@ -265,7 +265,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
timeinSeconds = hours + minutesInSeconds + seconds;
}
column.toBeSorted.push(`${timeinSeconds}#${i}`);
columnIndexAndTableRow[column.toBeSorted[i]] = innerOrOuterHTML(
columnIndexAndTableRow[column.toBeSorted[i]] = cellsOrRows(
table,
tr
);
Expand Down Expand Up @@ -307,15 +307,15 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
!isSortDates.monthDayYear
) {
column.toBeSorted.push(`${tdTextContent}#${i}`);
columnIndexAndTableRow[`${tdTextContent}#${i}`] = innerOrOuterHTML(
columnIndexAndTableRow[`${tdTextContent}#${i}`] = cellsOrRows(
table,
tr
);
}
} else {
// Fill in blank table cells dict key with filler value.
column.toBeSorted.push(`${fillValue}#${i}`);
columnIndexAndTableRow[`${fillValue}#${i}`] = innerOrOuterHTML(
columnIndexAndTableRow[`${fillValue}#${i}`] = cellsOrRows(
table,
tr
);
Expand Down

0 comments on commit ee0542a

Please sign in to comment.