Fix custom affiliation names
This commit is contained in:
parent
98834ec607
commit
0a84d99ce6
@ -161,12 +161,14 @@ export function start(startLoc, units, gbUnSelect, gbSelect) {
|
|||||||
const forces = createRecords(units);
|
const forces = createRecords(units);
|
||||||
|
|
||||||
for (const affiliation in forces) {
|
for (const affiliation in forces) {
|
||||||
const container = document.querySelector(`#${affiliation}-record .records`);
|
const container = document.querySelector(`#${affiliation}-record`);
|
||||||
const name = startLoc.dataset[`#${affiliation}-record ${affiliation}Name`];
|
const records = container.querySelector('.records');
|
||||||
|
const name = startLoc.dataset[`${affiliation}Name`];
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
container.querySelector('.name').textContent = name;
|
container.querySelector('.name').textContent = name;
|
||||||
}
|
}
|
||||||
forces[affiliation].forEach(r => container.appendChild(r));
|
forces[affiliation].forEach(r => records.appendChild(r));
|
||||||
}
|
}
|
||||||
|
|
||||||
addEventListeners(gbUnSelect, gbSelect);
|
addEventListeners(gbUnSelect, gbSelect);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user