summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-04-09 19:57:46 +0200
committerAki <please@ignore.pl>2021-04-09 19:57:46 +0200
commit8fa81a7134b595e3857d7719a8f45bb378d77b7e (patch)
tree381831ff3e99b7990a6bcbe51e5ccb9e4285bdde
parent21374ec7e96ad0543a1936be34fa5ab5a20dd7d4 (diff)
downloadderelict-prototype-8fa81a7134b595e3857d7719a8f45bb378d77b7e.zip
derelict-prototype-8fa81a7134b595e3857d7719a8f45bb378d77b7e.tar.gz
derelict-prototype-8fa81a7134b595e3857d7719a8f45bb378d77b7e.tar.bz2
Added group id to dataset of wreck elements
-rw-r--r--derelict.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/derelict.js b/derelict.js
index f328db6..4e735ce 100644
--- a/derelict.js
+++ b/derelict.js
@@ -64,9 +64,14 @@ class Wreck {
const team = killmail.team > 1 ? "teamA" : "teamB"
this.domElement.classList.add('wreck', team)
const shipTypeId = this.killmail.victim.ship_type_id
- fetch(`${ESI}/universe/types/${shipTypeId}/?datasource=tranquility`, {cache: "force-cache"})
+ fetch(`${ESI}/universe/types/${shipTypeId}/`, {cache: "force-cache"})
.then(response => response.json())
- .then(typeId => this.domElement.dataset.label = typeId.name)
+ .then(typeId => {
+ this.domElement.dataset.label = typeId.name
+ return fetch(`${ESI}/universe/groups/${typeId.group_id}/`, {cache: "force-cache"})
+ })
+ .then(response => response.json())
+ .then(group => this.domElement.dataset.group = group.name)
this.domElement.appendChild(iconElement)
this.point.position.copy(killmail.victim.position)
this.point.add(object2d)