Skip to content

Commit

Permalink
Have inital up and down arrow before user sorts column and change arr…
Browse files Browse the repository at this point in the history
…ows to be less bold.
  • Loading branch information
kyle-wannacott committed Dec 29, 2023
1 parent 40e34fe commit a339b12
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions public/table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
return sortAscending(b, a);
}

function clearArrows(arrowUp = "▲", arrowDown = "▼") {
function clearArrows(arrowUp, arrowDown, initialArrow = "↕") {
th.innerHTML = th.innerHTML.replace(initialArrow, "");
th.innerHTML = th.innerHTML.replace(arrowUp, "");
th.innerHTML = th.innerHTML.replace(arrowDown, "");
}
Expand Down Expand Up @@ -515,13 +516,12 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
columnIndexesClicked
) {
const desc = th.classList.contains("order-by-desc");
const arrow = { up: " ▲", down: " ▼" };
const initialArrow = " ↕";
const arrow = { up: " ↑", down: " ↓" };
const fillValue = "!X!Y!Z!";

if (desc && table.hasClass.tableArrows) {
th.insertAdjacentText("beforeend", arrow.down);
} else if (table.hasClass.tableArrows) {
th.insertAdjacentText("beforeend", arrow.up);
if (table.hasClass.tableArrows) {
th.insertAdjacentText("beforeend", initialArrow);
}

let timesClickedColumn = 0;
Expand Down

0 comments on commit a339b12

Please sign in to comment.