fix: append day section to DOM before file rows so getElementById works

_attachFileRowHandlers uses getElementById to wire up buttons; those
elements must already be in the document. Moving section.appendChild
and container.appendChild ahead of the file rows loop fixes the null
reference that silently dropped all rendered content.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 15:55:58 +02:00
parent 1e6ad2f3de
commit 0309faa993
+2 -3
View File
@@ -1148,6 +1148,8 @@ function renderFiles(files) {
</tr></thead>`;
const dayTbody = document.createElement('tbody');
table.appendChild(dayTbody);
section.appendChild(table);
container.appendChild(section);
// File rows
dayFiles.forEach(f => {
@@ -1219,9 +1221,6 @@ function renderFiles(files) {
_attachFileRowHandlers(f, isRec, expanded, dayId);
});
section.appendChild(table);
container.appendChild(section);
// Day toggle handler
document.getElementById('daytgl-' + dayId).addEventListener('click', () => {
const nowExp = !dayExpanded.get(dayId);