Skip to content

Commit

Permalink
Fix bug with table-arrows when class not applied.
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-wannacott committed Nov 8, 2024
1 parent 33deb6d commit f2ca1c7
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Examples on using table-sort-js with frontend frameworks such as [React.js](http
| <table> classes | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------ |
| "table-sort" | Make the table sortable! (Words, numbers, dates, file sizes)... |
| "table-arrows" | Display ascending or descending arrows. Supports custom arrows; example: "table-arrows-πŸ‘†πŸ€™πŸ‘‡" |
| "table-arrows" | Display ascending or descending arrows. Supports custom arrows; for example: "table-arrows-β‡ˆβ‡‹β‡Š" |
| "no-class-infer" | Turns off inference for adding sort classes automatically e.g (file-size-sort, dates-dmy-sort), etc. |
| "remember-sort" | If clicking on different columns remembers sort of the original column. |
| "cells-sort" | sort cells (td) rather than table rows (tr); useful for keeping table rows with classes/attributes in place. |
Expand Down
Binary file modified browser-extensions/chrome/table-sort-js.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion browser-extensions/chrome/table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
}

function changeArrowAndSort(arrowDirection, sortDirection) {
if (table.hasClass.tableArrows) {
if (table.hasClass.tableArrows[0]) {
clearArrows(arrow);
th.insertAdjacentText("beforeend", arrowDirection);
}
Expand Down
Binary file modified browser-extensions/firefox/table-sort-js.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion browser-extensions/firefox/table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
}

function changeArrowAndSort(arrowDirection, sortDirection) {
if (table.hasClass.tableArrows) {
if (table.hasClass.tableArrows[0]) {
clearArrows(arrow);
th.insertAdjacentText("beforeend", arrowDirection);
}
Expand Down
2 changes: 1 addition & 1 deletion npm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Examples on using table-sort-js with frontend frameworks such as [React.js](http
| <table> classes | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------ |
| "table-sort" | Make the table sortable! (Words, numbers, dates, file sizes)... |
| "table-arrows" | Display ascending or descending arrows. Supports custom arrows; example: "table-arrows-πŸ‘†πŸ€™πŸ‘‡" |
| "table-arrows" | Display ascending or descending arrows. Supports custom arrows; for example: "table-arrows-β‡ˆβ‡‹β‡Š" |
| "no-class-infer" | Turns off inference for adding sort classes automatically e.g (file-size-sort, dates-dmy-sort), etc. |
| "remember-sort" | If clicking on different columns remembers sort of the original column. |
| "cells-sort" | sort cells (td) rather than table rows (tr); useful for keeping table rows with classes/attributes in place. |
Expand Down
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "table-sort-js",
"version": "1.22.0",
"version": "1.22.1",
"description": "A JavaScript client-side HTML table sorting library with no dependencies required.",
"license": "MIT",
"repository": "LeeWannacott/table-sort-js",
Expand Down
2 changes: 1 addition & 1 deletion npm/table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
}

function changeArrowAndSort(arrowDirection, sortDirection) {
if (table.hasClass.tableArrows) {
if (table.hasClass.tableArrows[0]) {
clearArrows(arrow);
th.insertAdjacentText("beforeend", arrowDirection);
}
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<h1>Manual testing of table sort js</h1>
<!-- -->
<table class="table-sort table-arrows-πŸ‘†πŸ€™πŸ‘‡">
<table class="table-sort table-arrows-β‡ˆβ‡‹β‡Š">
<tr>
<td>Last Name</td>
<td>First Name</td>
Expand Down
2 changes: 1 addition & 1 deletion public/table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
}

function changeArrowAndSort(arrowDirection, sortDirection) {
if (table.hasClass.tableArrows) {
if (table.hasClass.tableArrows[0]) {
clearArrows(arrow);
th.insertAdjacentText("beforeend", arrowDirection);
}
Expand Down

0 comments on commit f2ca1c7

Please sign in to comment.