index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-08-05 16:56:46 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-08-05 16:56:46 -0700 |
commit | 7c2b441c7cea59631f6fb0588271b0fb5f10a79a (patch) | |
tree | afe393547b0123ffef1f9b1a890c3ab98c4ef693 /src/modules/record_sheet.js | |
parent | f35d716bd38d03285fa511f6794af5d93e88f4dc (diff) |
WIP: view squad record sheets
Diffstat (limited to 'src/modules/record_sheet.js')
-rw-r--r-- | src/modules/record_sheet.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/record_sheet.js b/src/modules/record_sheet.js index 824668e..e5be4bf 100644 --- a/src/modules/record_sheet.js +++ b/src/modules/record_sheet.js @@ -263,13 +263,14 @@ function endMove() { const selected = getSelected(); if (selected) { + const list = selected.closest('.records').querySelectorAll('.soldier-record:not(.movement-ended, .inactive)'); + const index = [...list].findIndex(s => s === selected); + const next = list.length > 1 ? list[(index + 1) % list.length] : null; selected.classList.toggle('movement-ended'); - const next = selected.parentElement.querySelector(`.soldier-record[data-squad="${selected.dataset.squad}"]:not(.movement-ended, .inactive)`); deselect(); if (next) { Observable.notify('select', next); - next.scrollIntoView({ behavior: 'smooth' }); } } } |