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')
-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 2865309..33a21fe 100644 --- a/src/modules/record_sheet.js +++ b/src/modules/record_sheet.js @@ -81,12 +81,13 @@ function createWeaponIcon(type) { function createRecord(unit) { const { dataset: { allegiance, number, squad }} = unit, primaryWeapon = unit.querySelector('.primary-weapon'), - pw = primaryWeapon?.getAttribute('href').replace('#', '') || 'rifle', + pw = primaryWeapon.getAttributeNS(null, 'href').split('#').pop() || 'rifle', div = document.createElement('div', { is: 'soldier-record-block' }), spans = Array(6).fill('span').map(t => document.createElement(t)), [tn, sn, pwt, pwd, pwrs, pwrl] = spans; - div.setAttribute('class', 'soldier-record'); + div.classList.add('soldier-record'); + if (unit.classList.contains('selected')) div.classList.add('selected'); div.dataset.number = number; div.dataset.allegiance = allegiance; |