Skip to content

Commit a339b12

Browse files
Have inital up and down arrow before user sorts column and change arrows to be less bold.
1 parent 40e34fe commit a339b12

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

public/table-sort.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
383383
return sortAscending(b, a);
384384
}
385385

386-
function clearArrows(arrowUp = "▲", arrowDown = "▼") {
386+
function clearArrows(arrowUp, arrowDown, initialArrow = "↕") {
387+
th.innerHTML = th.innerHTML.replace(initialArrow, "");
387388
th.innerHTML = th.innerHTML.replace(arrowUp, "");
388389
th.innerHTML = th.innerHTML.replace(arrowDown, "");
389390
}
@@ -515,13 +516,12 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
515516
columnIndexesClicked
516517
) {
517518
const desc = th.classList.contains("order-by-desc");
518-
const arrow = { up: " ▲", down: " ▼" };
519+
const initialArrow = " ↕";
520+
const arrow = { up: " ↑", down: " ↓" };
519521
const fillValue = "!X!Y!Z!";
520522

521-
if (desc && table.hasClass.tableArrows) {
522-
th.insertAdjacentText("beforeend", arrow.down);
523-
} else if (table.hasClass.tableArrows) {
524-
th.insertAdjacentText("beforeend", arrow.up);
523+
if (table.hasClass.tableArrows) {
524+
th.insertAdjacentText("beforeend", initialArrow);
525525
}
526526

527527
let timesClickedColumn = 0;

0 commit comments

Comments
 (0)