mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 01:09:25 +00:00
Inspector: Preserve zebra-striping when hiding table rows
Instead of simply setting rows to hidden, add a class so that we can only include visible rows when applying zebra-striping.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
a10984ea03
commit
37ca2fc25c
@@ -295,7 +295,11 @@ details > :not(:first-child) {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.property-table tr:nth-child(even) {
|
.hidden-row {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.property-table tr:nth-child(even of :not(.hidden-row)) {
|
||||||
background-color: var(--property-table-row);
|
background-color: var(--property-table-row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -339,7 +339,13 @@ inspector.setStyleSheetSource = (identifier, sourceBase64) => {
|
|||||||
const applyPropertyFilter = (row, searchText) => {
|
const applyPropertyFilter = (row, searchText) => {
|
||||||
const nameMatch = row.cells[0].textContent.toLowerCase().includes(searchText);
|
const nameMatch = row.cells[0].textContent.toLowerCase().includes(searchText);
|
||||||
const valueMatch = row.cells[1].textContent.toLowerCase().includes(searchText);
|
const valueMatch = row.cells[1].textContent.toLowerCase().includes(searchText);
|
||||||
row.style.display = nameMatch || valueMatch ? "" : "none";
|
let matches = nameMatch || valueMatch;
|
||||||
|
|
||||||
|
if (matches) {
|
||||||
|
row.classList.remove("hidden-row");
|
||||||
|
} else {
|
||||||
|
row.classList.add("hidden-row");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const setupPropertyFilter = inputId => {
|
const setupPropertyFilter = inputId => {
|
||||||
|
|||||||
Reference in New Issue
Block a user