From 0a84d99ce603ef8c69b431c5d968f5f73cb066ef Mon Sep 17 00:00:00 2001 From: Catalin Constantin Mititiuc Date: Mon, 16 Jun 2025 22:41:31 -0700 Subject: [PATCH] Fix custom affiliation names --- src/modules/record_sheet.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/record_sheet.js b/src/modules/record_sheet.js index a9fb1c4..bf28875 100644 --- a/src/modules/record_sheet.js +++ b/src/modules/record_sheet.js @@ -161,12 +161,14 @@ export function start(startLoc, units, gbUnSelect, gbSelect) { const forces = createRecords(units); for (const affiliation in forces) { - const container = document.querySelector(`#${affiliation}-record .records`); - const name = startLoc.dataset[`#${affiliation}-record ${affiliation}Name`]; + const container = document.querySelector(`#${affiliation}-record`); + const records = container.querySelector('.records'); + const name = startLoc.dataset[`${affiliation}Name`]; + if (name) { container.querySelector('.name').textContent = name; } - forces[affiliation].forEach(r => container.appendChild(r)); + forces[affiliation].forEach(r => records.appendChild(r)); } addEventListeners(gbUnSelect, gbSelect);