Add null checks for empty dataview queries (#157)

This commit is contained in:
ransurf 2023-05-22 07:42:02 -07:00 committed by GitHub
parent 2c14fcc1b9
commit 52e0aad72c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -400,12 +400,12 @@ module.exports = function (eleventyConfig) {
)) {
t.classList.add("dataview");
t.classList.add("table-view-table");
t.querySelector("thead").classList.add("table-view-thead");
t.querySelector("tbody").classList.add("table-view-tbody");
t.querySelectorAll("thead > tr").forEach((tr) => {
t.querySelector("thead")?.classList.add("table-view-thead");
t.querySelector("tbody")?.classList.add("table-view-tbody");
t.querySelectorAll("thead > tr")?.forEach((tr) => {
tr.classList.add("table-view-tr-header");
});
t.querySelectorAll("thead > tr > th").forEach((th) => {
t.querySelectorAll("thead > tr > th")?.forEach((th) => {
th.classList.add("table-view-th");
});
}