tooltips fix
This commit is contained in:
@@ -35,7 +35,8 @@ export class FrontcraftArmoryComponent implements OnInit{
|
||||
itemname: item.name,
|
||||
iconname: item.icon.replace('.jpg', ''),
|
||||
quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
|
||||
url: "https://classic.wowhead.com/item="+item.id
|
||||
url: "https://classic.wowhead.com/item="+item.id,
|
||||
tooltip: "unavailable"
|
||||
}})
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ export class FrontcraftCharacterComponent implements OnInit{
|
||||
gear1:string[] = []
|
||||
|
||||
boss2= {}
|
||||
gear2:Item[] = []
|
||||
gear2:string[] = []
|
||||
|
||||
constructor(
|
||||
private api: ApiService,
|
||||
@@ -50,7 +50,7 @@ export class FrontcraftCharacterComponent implements OnInit{
|
||||
|
||||
|
||||
|
||||
fetch(this.dataLink).then(raw => raw.json().then(async (json) => {
|
||||
fetch(this.dataLink).then(raw => raw.json().then((json) => {
|
||||
if(json.length < 1) return
|
||||
const data = json[0]
|
||||
|
||||
@@ -58,14 +58,18 @@ export class FrontcraftCharacterComponent implements OnInit{
|
||||
name: data.encounterName,
|
||||
date: data.startTime
|
||||
}
|
||||
|
||||
this.gear2 = await Promise.all(data.gear.map(i => i.name).map(itemName => this.api.get('ItemManager').getItem(itemName)))
|
||||
this.gear2 = this.gear2.filter(i => i!=null)
|
||||
|
||||
this.gear2 = data.gear.map(item => {return <Item>{
|
||||
itemname: item.name,
|
||||
iconname: item.icon.replace('.jpg', ''),
|
||||
quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
|
||||
url: "https://classic.wowhead.com/item="+item.id,
|
||||
tooltip: "unavailable"
|
||||
}}).filter(item => item.itemname != "Unknown Item")
|
||||
}))
|
||||
|
||||
fetch(this.dataLink).then(raw => raw.json().then(async (json) => {
|
||||
fetch(this.dataLink).then(raw => raw.json().then((json) => {
|
||||
if(json.length < 2) return
|
||||
|
||||
const data = json[1]
|
||||
|
||||
this.boss1 = {
|
||||
@@ -73,9 +77,13 @@ export class FrontcraftCharacterComponent implements OnInit{
|
||||
date: data.startTime
|
||||
}
|
||||
|
||||
|
||||
this.gear1 = await Promise.all(data.gear.map(i => i.name).map(itemName => this.api.get('ItemManager').getItem(itemName)))
|
||||
this.gear1 = this.gear1.filter(i => i!=null)
|
||||
this.gear1 = data.gear.map(item => {return <Item>{
|
||||
itemname: item.name,
|
||||
iconname: item.icon.replace('.jpg', ''),
|
||||
quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
|
||||
url: "https://classic.wowhead.com/item="+item.id,
|
||||
tooltip: "unavailable"
|
||||
}}).filter(item => item.itemname != "Unknown Item")
|
||||
}))
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user