index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-05-20 14:07:00 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-05-20 14:07:00 -0700 |
commit | 517c89b1cca85638f26d9987bc8b222d0a56ec6b (patch) | |
tree | a9943af91f60bde3273c7b3166d415d3554f3d83 | |
parent | 6b4312aa1f7fc49cd212d9557f71f3624e0f145f (diff) |
Fix custom affiliation names
-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); |