diff --git a/browser-extensions/chrome/manifest.json b/browser-extensions/chrome/manifest.json index 9ae9c69..1ffe418 100644 --- a/browser-extensions/chrome/manifest.json +++ b/browser-extensions/chrome/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "author": "Lee Wannacott", "name": "table-sort-js", - "version": "1.18.2", + "version": "1.18.3", "description": "Makes tables sortable using table-sort-js: https://github.com/LeeWannacott/table-sort-js", "icons": { "48": "icons/t.png" }, "browser_action": { diff --git a/browser-extensions/chrome/table-sort-js.zip b/browser-extensions/chrome/table-sort-js.zip index 9a0a3ba..67a3ee3 100644 Binary files a/browser-extensions/chrome/table-sort-js.zip and b/browser-extensions/chrome/table-sort-js.zip differ diff --git a/browser-extensions/chrome/table-sort.js b/browser-extensions/chrome/table-sort.js index d6a335a..345a4bf 100644 --- a/browser-extensions/chrome/table-sort.js +++ b/browser-extensions/chrome/table-sort.js @@ -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, ""); } @@ -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; diff --git a/browser-extensions/firefox/manifest.json b/browser-extensions/firefox/manifest.json index 15115f1..318785b 100644 --- a/browser-extensions/firefox/manifest.json +++ b/browser-extensions/firefox/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "author": "Lee Wannacott", "name": "table-sort-js", - "version": "1.18.2", + "version": "1.18.3", "description": "Makes tables sortable using table-sort-js: https://github.com/LeeWannacott/table-sort-js", "icons": { "48": "icons/t.png" }, "browser_action": { diff --git a/browser-extensions/firefox/table-sort-js.zip b/browser-extensions/firefox/table-sort-js.zip index 276a263..bf13158 100644 Binary files a/browser-extensions/firefox/table-sort-js.zip and b/browser-extensions/firefox/table-sort-js.zip differ diff --git a/browser-extensions/firefox/table-sort.js b/browser-extensions/firefox/table-sort.js index d6a335a..345a4bf 100644 --- a/browser-extensions/firefox/table-sort.js +++ b/browser-extensions/firefox/table-sort.js @@ -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, ""); } @@ -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; diff --git a/npm/package.json b/npm/package.json index fafa8bc..f8214ed 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "table-sort-js", - "version": "1.18.2", + "version": "1.18.3", "description": "A JavaScript client-side HTML table sorting library with no dependencies required.", "license": "MIT", "repository": "LeeWannacott/table-sort-js", diff --git a/npm/table-sort.js b/npm/table-sort.js index d6a335a..345a4bf 100644 --- a/npm/table-sort.js +++ b/npm/table-sort.js @@ -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, ""); } @@ -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;