WIP: select counter test
This commit is contained in:
@@ -200,7 +200,8 @@ function endMove() {
|
||||
export function start(el) {
|
||||
svg = el;
|
||||
|
||||
getUnits(svg).forEach(unit => unit.addEventListener('click', selectOffBoard));
|
||||
const startingLocations = svg.querySelector('.start-locations');
|
||||
startingLocations && getUnits(startingLocations).forEach(unit => unit.addEventListener('click', selectOffBoard));
|
||||
|
||||
getCells(svg).forEach(cell => {
|
||||
cell.addEventListener('click', e => {
|
||||
|
||||
@@ -179,7 +179,7 @@ export function start(startLoc, units) {
|
||||
for (const affiliation in forces) {
|
||||
const container = document.querySelector(`#${affiliation}-record`);
|
||||
const records = container.querySelector('.records');
|
||||
const name = startLoc.dataset[`${affiliation}Name`];
|
||||
const name = startLoc?.dataset[`${affiliation}Name`];
|
||||
|
||||
if (name) {
|
||||
container.querySelector('.name').textContent = name;
|
||||
|
||||
Reference in New Issue
Block a user