Somewhat working

This commit is contained in:
Magnus Åhall 2026-02-23 07:59:45 +01:00
parent ad638acaf3
commit 4637689db4
6 changed files with 52 additions and 12 deletions

View file

@ -17,18 +17,35 @@ body {
}
.records-tree {
display: grid;
.fqdn, .record {
border-bottom: 1px solid #aaa;
padding: 4px 0px;
}
.top {
font-weight: bold;
margin-left: 16px;
}
&>.top {
margin-left: 0px;
}
.record {
display: none;
font-weight: normal;
color: #444;
&.show {
display: block;
}
span:first-child {
color: #800033;
}
span:last-child {
color: #888;
}
}
}

View file

@ -10,8 +10,11 @@ export class Application {
handlerTop(event) {
const fqdn = event.target
const top = fqdn.closest('.top')
const records = top.querySelector('.records')
console.log(fqdn, top, records)
const topEl = fqdn.closest('.top')
const records = document.querySelectorAll(`.record[data-top="${topEl.dataset.top}"]`)
console.log(`.record[data-top="${topEl.dataset.top}"]`)
console.log(topEl.dataset.top, records)
for (const r of records)
r.classList.toggle('show')
}
}