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:
@@ -1148,6 +1148,8 @@ function renderFiles(files) {
|
|||||||
</tr></thead>`;
|
</tr></thead>`;
|
||||||
const dayTbody = document.createElement('tbody');
|
const dayTbody = document.createElement('tbody');
|
||||||
table.appendChild(dayTbody);
|
table.appendChild(dayTbody);
|
||||||
|
section.appendChild(table);
|
||||||
|
container.appendChild(section);
|
||||||
|
|
||||||
// File rows
|
// File rows
|
||||||
dayFiles.forEach(f => {
|
dayFiles.forEach(f => {
|
||||||
@@ -1219,9 +1221,6 @@ function renderFiles(files) {
|
|||||||
_attachFileRowHandlers(f, isRec, expanded, dayId);
|
_attachFileRowHandlers(f, isRec, expanded, dayId);
|
||||||
});
|
});
|
||||||
|
|
||||||
section.appendChild(table);
|
|
||||||
container.appendChild(section);
|
|
||||||
|
|
||||||
// Day toggle handler
|
// Day toggle handler
|
||||||
document.getElementById('daytgl-' + dayId).addEventListener('click', () => {
|
document.getElementById('daytgl-' + dayId).addEventListener('click', () => {
|
||||||
const nowExp = !dayExpanded.get(dayId);
|
const nowExp = !dayExpanded.get(dayId);
|
||||||
|
|||||||
Reference in New Issue
Block a user