Reassign first and last row global var after sorting.
This commit is contained in:
parent
182726f3e3
commit
50d2c6a8bd
@ -9,8 +9,8 @@ const overlay_content = overlay.children[1].firstChild;
|
|||||||
const overlay_label = overlay.children[1].lastChild;
|
const overlay_label = overlay.children[1].lastChild;
|
||||||
|
|
||||||
const g_tbody = document.getElementsByTagName('tbody')[0];
|
const g_tbody = document.getElementsByTagName('tbody')[0];
|
||||||
const g_first_row = g_tbody.firstChild;
|
let g_first_row = g_tbody.firstChild;
|
||||||
const g_last_row = g_tbody.lastChild;
|
let g_last_row = g_tbody.lastChild;
|
||||||
const g_back_row = document.getElementsByTagName("tr")[1];
|
const g_back_row = document.getElementsByTagName("tr")[1];
|
||||||
|
|
||||||
let g_scale = 1;
|
let g_scale = 1;
|
||||||
@ -184,6 +184,8 @@ thead_name.addEventListener('click', e => {
|
|||||||
const b_name = b.children[0].textContent.toLowerCase();
|
const b_name = b.children[0].textContent.toLowerCase();
|
||||||
return a_name < b_name ? -1 : a_name > b_name ? 1 : 0;
|
return a_name < b_name ? -1 : a_name > b_name ? 1 : 0;
|
||||||
}, null, null, thead_name, [thead_date, thead_size]);
|
}, null, null, thead_name, [thead_date, thead_size]);
|
||||||
|
g_first_row = g_tbody.firstChild;
|
||||||
|
g_last_row = g_tbody.lastChild;
|
||||||
});
|
});
|
||||||
|
|
||||||
thead_date.classList.toggle("clickable");
|
thead_date.classList.toggle("clickable");
|
||||||
@ -194,6 +196,8 @@ thead_date.addEventListener('click', e => {
|
|||||||
const b_date = new Date(b.children[1].textContent.slice(0, -4));
|
const b_date = new Date(b.children[1].textContent.slice(0, -4));
|
||||||
return a_date - b_date;
|
return a_date - b_date;
|
||||||
}, null, null, thead_date, [thead_name, thead_size]);
|
}, null, null, thead_date, [thead_name, thead_size]);
|
||||||
|
g_first_row = g_tbody.firstChild;
|
||||||
|
g_last_row = g_tbody.lastChild;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -217,6 +221,8 @@ thead_size.addEventListener('click', e => {
|
|||||||
e => e.children[2].textContent == "DIR",
|
e => e.children[2].textContent == "DIR",
|
||||||
e => e.children[2].textContent != "DIR",
|
e => e.children[2].textContent != "DIR",
|
||||||
thead_size, [thead_name, thead_date]);
|
thead_size, [thead_name, thead_date]);
|
||||||
|
g_first_row = g_tbody.firstChild;
|
||||||
|
g_last_row = g_tbody.lastChild;
|
||||||
});
|
});
|
||||||
|
|
||||||
function sortTable(compareFn, filterFn, filterNegFn, target, other) {
|
function sortTable(compareFn, filterFn, filterNegFn, target, other) {
|
||||||
|
Loading…
Reference in New Issue
Block a user