index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/modules/record_sheet.js')
-rw-r--r-- | src/modules/record_sheet.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/modules/record_sheet.js b/src/modules/record_sheet.js index f13f5f8..9fbca9d 100644 --- a/src/modules/record_sheet.js +++ b/src/modules/record_sheet.js @@ -106,12 +106,6 @@ function getRecord({ dataset: { allegiance: al, number: n }}) { return document.querySelector(selector); } -function addEventListeners() { - document.querySelectorAll('.soldier-record').forEach(el => - el.addEventListener('click', () => Observable.notify('select', el)) - ); -} - function deselect() { const selected = getSelected(); @@ -166,7 +160,10 @@ export function start(startLoc, units) { forces[affiliation].forEach(r => records.appendChild(r)); } + document.querySelectorAll('.soldier-record').forEach(el => + el.addEventListener('click', () => Observable.notify('select', el)) + ); + Observable.subscribe('select', select); Observable.subscribe('endmove', endMove); - addEventListeners(); } |