fix filter after sort by fail

This commit is contained in:
NightFox 2024-02-15 18:23:45 +03:00
parent 81b1d65d97
commit e31145b06f

View File

@ -319,7 +319,7 @@ window.onload = () => {
saveToLocalStorage("rendertest_switchfrequency", value);
}
let gridContainer, sidebarOptions, numberInput, rangeInput, table, images, vpaddin_input;
let gridContainer, sidebarOptions, numberInput, rangeInput, table, images, vpaddin_input, filter;
const switchFrequency = loadFromLocalStorage("rendertest_switchfrequency", 700);
const tableSort = loadFromLocalStorage("rendertest_tablesort", false);
@ -530,13 +530,13 @@ window.onload = () => {
]),
Tag("label", null, null, [
Tag("input", {"type": "radio", "name": "sort_table", "value": "yes", ...uglyChecked(tableSort)}, null, null, "input", (e) => {
buildData(table, images, data, true);
buildData(table, images, data, true, filter.value);
}),
Text(" yes")
]),
Tag("label", null, null, [
Tag("input", {"type": "radio", "name": "sort_table", "value": "no", ...uglyChecked(!tableSort)}, null, null, "input", (e) => {
buildData(table, images, data, false);
buildData(table, images, data, false, filter.value);
}),
Text(" no")
])
@ -545,7 +545,7 @@ window.onload = () => {
Tag("div", {"class": "panel", "id": "table"}, null, [
Tag("h2", null, "List of things that are not perfect"),
Tag("label", {"class": "filter sticky"}, "Filter", [
Tag("input", {"type": "input", "name": "filter", "value": ""}, null, null, "input", (e) => {
filter = Tag("input", {"type": "input", "name": "filter", "value": ""}, null, null, "input", (e) => {
buildDataSlowMode(table, images, data, tableSort, e.target.value);
}),
]),