Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/record_sheet.js8
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);