Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/record_sheet.js')
-rw-r--r--src/modules/record_sheet.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/record_sheet.js b/src/modules/record_sheet.js
index 0f279d5..5f14852 100644
--- a/src/modules/record_sheet.js
+++ b/src/modules/record_sheet.js
@@ -152,6 +152,18 @@ function endMove() {
deselect();
}
+export function extractWeaponFromRecord(recordEl) {
+ return recordEl
+ .querySelector('[slot="primary-weapon-type"] use')
+ .getAttributeNS(null, 'href')
+ .split('#')
+ .pop();
+}
+
+export function isRecord(el) {
+ return el.classList && el.classList.contains('soldier-record');
+}
+
export function getSelected() {
return document.querySelector('.soldier-record.selected');
}