Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/record_sheet.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/record_sheet.js b/src/modules/record_sheet.js
index 9fd5b62..a9fb1c4 100644
--- a/src/modules/record_sheet.js
+++ b/src/modules/record_sheet.js
@@ -113,7 +113,7 @@ function addEventListeners(unSelectCounter, selectCounter) {
}
export function clear() {
- document.querySelectorAll('#attacker-record > div, #defender-record > div').forEach(el => el.remove());
+ document.querySelectorAll('#record-sheet .soldier-record').forEach(el => el.remove());
document.querySelector('#attacker-record .name').textContent = 'attacker';
document.querySelector('#defender-record .name').textContent = 'defender';
}
@@ -161,8 +161,8 @@ export function start(startLoc, units, gbUnSelect, gbSelect) {
const forces = createRecords(units);
for (const affiliation in forces) {
- const container = document.querySelector(`#${affiliation}-record`);
- const name = startLoc.dataset[`${affiliation}Name`];
+ const container = document.querySelector(`#${affiliation}-record .records`);
+ const name = startLoc.dataset[`#${affiliation}-record ${affiliation}Name`];
if (name) {
container.querySelector('.name').textContent = name;
}