removed debug statements

This commit is contained in:
tracer 2022-10-25 18:27:13 +02:00
parent 8e0a2ff6e8
commit 47439fe358
1 changed files with 0 additions and 13 deletions

View File

@ -78,11 +78,8 @@ function deleteAddress(id) {
} }
function sortBy(column) { function sortBy(column) {
console.log("sortby: " + column)
// switch direction on every call // switch direction on every call
let currentSortOrder = document.getElementById(column + '_sort') let currentSortOrder = document.getElementById(column + '_sort')
let sortOrder = 0
if (currentSortOrder.innerHTML === 'asc') { if (currentSortOrder.innerHTML === 'asc') {
currentSortOrder.innerHTML = 'desc' currentSortOrder.innerHTML = 'desc'
} else { } else {
@ -93,11 +90,9 @@ function sortBy(column) {
let dirty = true; let dirty = true;
// loop until clean // loop until clean
while (dirty) { while (dirty) {
console.log('dirty', dirty)
// assume we are finished // assume we are finished
dirty = false dirty = false
const rows = table.rows; const rows = table.rows;
console.log(rows)
for (let i = 1; i < (rows.length - 2); i++) { for (let i = 1; i < (rows.length - 2); i++) {
let x = rows[i] let x = rows[i]
let rowXId = x.id let rowXId = x.id
@ -109,9 +104,6 @@ function sortBy(column) {
let rowYNumber = rowYId.charAt(rowYId.length -1) let rowYNumber = rowYId.charAt(rowYId.length -1)
let valueY = document.getElementById(column + '_' + rowYNumber).value let valueY = document.getElementById(column + '_' + rowYNumber).value
console.log(valueX, valueY)
// mind asc & desc
let currentSortOrder = document.getElementById(column + '_sort') let currentSortOrder = document.getElementById(column + '_sort')
let sortOrder = 0 let sortOrder = 0
if (currentSortOrder.innerHTML === 'asc') { if (currentSortOrder.innerHTML === 'asc') {
@ -119,12 +111,7 @@ function sortBy(column) {
} else { } else {
sortOrder = -1 sortOrder = -1
} }
console.log("cs", currentSortOrder.innerHTML)
console.log(valueX.localeCompare(valueY))
if (valueX.localeCompare(valueY) === sortOrder) { if (valueX.localeCompare(valueY) === sortOrder) {
console.log('switch A')
// switch rows
x.parentNode.insertBefore(y, x); x.parentNode.insertBefore(y, x);
dirty = true dirty = true
} }