index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/record_sheet.js | 8 |
1 files 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); |