removed sort indicator from html table
This commit is contained in:
parent
dc78e203ea
commit
1541d05715
|
@ -99,16 +99,15 @@ function sortBy(column) {
|
|||
)
|
||||
|
||||
// switch direction on every call
|
||||
let currentSortOrder = document.getElementById(column + '_sort')
|
||||
let currentTitleElement = document.getElementById(column)
|
||||
let currentTitle = currentTitleElement.innerHTML
|
||||
|
||||
let newTitle
|
||||
if (currentSortOrder.innerHTML === 'asc') {
|
||||
currentSortOrder.innerHTML = 'desc'
|
||||
if (currentSortOrder === 'asc') {
|
||||
currentSortOrder = 'desc'
|
||||
newTitle = currentTitle[0] + currentTitle.substring(1) + ' ⬇'
|
||||
} else {
|
||||
currentSortOrder.innerHTML = 'asc'
|
||||
currentSortOrder = 'asc'
|
||||
newTitle = currentTitle[0] + currentTitle.substring(1) + ' ⬆'
|
||||
}
|
||||
currentTitleElement.innerHTML = newTitle
|
||||
|
@ -131,9 +130,8 @@ function sortBy(column) {
|
|||
let rowYNumber = rowYId.match(/\d+/)
|
||||
let valueY = document.getElementById(column + '_' + rowYNumber).value
|
||||
|
||||
let currentSortOrder = document.getElementById(column + '_sort')
|
||||
let sortOrder
|
||||
if (currentSortOrder.innerHTML === 'asc') {
|
||||
if (currentSortOrder === 'asc') {
|
||||
sortOrder = 1
|
||||
} else {
|
||||
sortOrder = -1
|
||||
|
@ -183,6 +181,9 @@ function closeError() {
|
|||
|
||||
}
|
||||
|
||||
// global scope
|
||||
let currentSortOrder = 'desc'
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const table = document.getElementById('address_table') || false
|
||||
if (table) {
|
||||
|
|
Loading…
Reference in New Issue