From a56f7dbad4bd35c3b648172dd8390f5b80e10665 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 30 Sep 2018 10:40:48 +0200 Subject: [PATCH] Only sort table tbody - bug fix --- UI/Component/Table.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/Component/Table.js b/UI/Component/Table.js index c9b9481..62ba86a 100644 --- a/UI/Component/Table.js +++ b/UI/Component/Table.js @@ -98,7 +98,7 @@ jsOMS.preventAll(event); const table = document.getElementById(id), - rows = table.rows, + rows = table.getElementsByTagName('tbody')[0].rows, rowLength = rows.length, cellId = this.closest('td').cellIndex; @@ -109,7 +109,7 @@ do { order = false; - for (j = 1; j < rowLength - 1; ++j) { + for (j = 0; j < rowLength - 1; ++j) { shouldSwitch = false; row1 = rows[j].getElementsByTagName('td')[cellId]; row2 = rows[j + 1].getElementsByTagName('td')[cellId];