Skip to content

Commit f2ca1c7

Browse files
Fix bug with table-arrows when class not applied.
1 parent 33deb6d commit f2ca1c7

File tree

10 files changed

+8
-8
lines changed

10 files changed

+8
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Examples on using table-sort-js with frontend frameworks such as [React.js](http
5454
| <table> classes | Description |
5555
| --------------------- | ------------------------------------------------------------------------------------------------------------ |
5656
| "table-sort" | Make the table sortable! (Words, numbers, dates, file sizes)... |
57-
| "table-arrows" | Display ascending or descending arrows. Supports custom arrows; example: "table-arrows-👆🤙👇" |
57+
| "table-arrows" | Display ascending or descending arrows. Supports custom arrows; for example: "table-arrows-⇈⇋⇊" |
5858
| "no-class-infer" | Turns off inference for adding sort classes automatically e.g (file-size-sort, dates-dmy-sort), etc. |
5959
| "remember-sort" | If clicking on different columns remembers sort of the original column. |
6060
| "cells-sort" | sort cells (td) rather than table rows (tr); useful for keeping table rows with classes/attributes in place. |
-3 Bytes
Binary file not shown.

browser-extensions/chrome/table-sort.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
400400
}
401401

402402
function changeArrowAndSort(arrowDirection, sortDirection) {
403-
if (table.hasClass.tableArrows) {
403+
if (table.hasClass.tableArrows[0]) {
404404
clearArrows(arrow);
405405
th.insertAdjacentText("beforeend", arrowDirection);
406406
}
-3 Bytes
Binary file not shown.

browser-extensions/firefox/table-sort.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
400400
}
401401

402402
function changeArrowAndSort(arrowDirection, sortDirection) {
403-
if (table.hasClass.tableArrows) {
403+
if (table.hasClass.tableArrows[0]) {
404404
clearArrows(arrow);
405405
th.insertAdjacentText("beforeend", arrowDirection);
406406
}

npm/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Examples on using table-sort-js with frontend frameworks such as [React.js](http
5454
| <table> classes | Description |
5555
| --------------------- | ------------------------------------------------------------------------------------------------------------ |
5656
| "table-sort" | Make the table sortable! (Words, numbers, dates, file sizes)... |
57-
| "table-arrows" | Display ascending or descending arrows. Supports custom arrows; example: "table-arrows-👆🤙👇" |
57+
| "table-arrows" | Display ascending or descending arrows. Supports custom arrows; for example: "table-arrows-⇈⇋⇊" |
5858
| "no-class-infer" | Turns off inference for adding sort classes automatically e.g (file-size-sort, dates-dmy-sort), etc. |
5959
| "remember-sort" | If clicking on different columns remembers sort of the original column. |
6060
| "cells-sort" | sort cells (td) rather than table rows (tr); useful for keeping table rows with classes/attributes in place. |

npm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "table-sort-js",
3-
"version": "1.22.0",
3+
"version": "1.22.1",
44
"description": "A JavaScript client-side HTML table sorting library with no dependencies required.",
55
"license": "MIT",
66
"repository": "LeeWannacott/table-sort-js",

npm/table-sort.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
400400
}
401401

402402
function changeArrowAndSort(arrowDirection, sortDirection) {
403-
if (table.hasClass.tableArrows) {
403+
if (table.hasClass.tableArrows[0]) {
404404
clearArrows(arrow);
405405
th.insertAdjacentText("beforeend", arrowDirection);
406406
}

public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<h1>Manual testing of table sort js</h1>
1010
<!-- -->
11-
<table class="table-sort table-arrows-👆🤙👇">
11+
<table class="table-sort table-arrows-⇈⇋⇊">
1212
<tr>
1313
<td>Last Name</td>
1414
<td>First Name</td>

public/table-sort.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
400400
}
401401

402402
function changeArrowAndSort(arrowDirection, sortDirection) {
403-
if (table.hasClass.tableArrows) {
403+
if (table.hasClass.tableArrows[0]) {
404404
clearArrows(arrow);
405405
th.insertAdjacentText("beforeend", arrowDirection);
406406
}

0 commit comments

Comments
 (0)