revert(viewer): restore separate filter row below header
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,8 +36,14 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
if (emptyNotice) emptyNotice.hidden = visibleCount > 0;
|
||||
}
|
||||
|
||||
const filterRow = document.createElement("tr");
|
||||
filterRow.className = "filter-row";
|
||||
|
||||
headerCells.forEach((th, colIndex) => {
|
||||
const colName = th.dataset.col || "";
|
||||
const filterTh = document.createElement("th");
|
||||
if (th.className) filterTh.className = th.className;
|
||||
|
||||
const isIconCol = colName === "severity_icon" || colName === "status";
|
||||
|
||||
if (isIconCol) {
|
||||
@@ -68,22 +74,12 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
activeFilters.set(colIndex, select.value);
|
||||
applyFilters();
|
||||
});
|
||||
th.textContent = "";
|
||||
th.appendChild(select);
|
||||
filterTh.appendChild(select);
|
||||
}
|
||||
} else if (colName) {
|
||||
const wrap = document.createElement("div");
|
||||
wrap.className = "col-filter-wrap";
|
||||
|
||||
const ghost = document.createElement("span");
|
||||
ghost.className = "col-filter-ghost";
|
||||
ghost.setAttribute("aria-hidden", "true");
|
||||
ghost.textContent = colName;
|
||||
|
||||
const input = document.createElement("input");
|
||||
input.type = "text";
|
||||
input.className = "col-filter col-filter-text";
|
||||
input.placeholder = colName;
|
||||
input.setAttribute("aria-label", "filter " + colName);
|
||||
let debounceTimer;
|
||||
input.addEventListener("input", () => {
|
||||
@@ -93,12 +89,12 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
applyFilters();
|
||||
}, 300);
|
||||
});
|
||||
|
||||
wrap.appendChild(ghost);
|
||||
wrap.appendChild(input);
|
||||
th.textContent = "";
|
||||
th.appendChild(wrap);
|
||||
filterTh.appendChild(input);
|
||||
}
|
||||
|
||||
filterRow.appendChild(filterTh);
|
||||
});
|
||||
|
||||
thead.appendChild(filterRow);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user