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