Compare commits

..

2 Commits

Author SHA1 Message Date
tracer 5a805aba07 removed sort indicator from html table 2022-10-29 14:07:12 +02:00
tracer 1541d05715 removed sort indicator from html table 2022-10-29 14:06:56 +02:00
2 changed files with 7 additions and 14 deletions

View File

@ -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) {

View File

@ -33,14 +33,6 @@
</td>
</tr>
<?php endforeach; ?>
<tr style="display:none;">
<td id="first_sort">desc</td>
<td id="last_sort">desc</td>
<td id="street_sort">desc</td>
<td id="zip_sort">desc</td>
<td id="city_sort">desc</td>
<td id="phone_sort">desc</td>
</tr>
</table>
</form>