Show character ranking in info table
This commit is contained in:
@ -163,6 +163,7 @@ export default class AnimeNotifier {
|
||||
Promise.resolve().then(() => this.updatePushUI()),
|
||||
Promise.resolve().then(() => this.dragAndDrop()),
|
||||
Promise.resolve().then(() => this.colorStripes()),
|
||||
Promise.resolve().then(() => this.loadCharacterRanking()),
|
||||
Promise.resolve().then(() => this.assignTooltipOffsets()),
|
||||
Promise.resolve().then(() => this.countUp())
|
||||
])
|
||||
@ -431,6 +432,26 @@ export default class AnimeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
loadCharacterRanking() {
|
||||
if(!this.app.currentPath.includes("/character/")) {
|
||||
return
|
||||
}
|
||||
|
||||
for(let element of findAll("character-ranking")) {
|
||||
fetch(`/api/character/${element.dataset.characterId}/ranking`).then(async response => {
|
||||
let ranking = await response.text()
|
||||
|
||||
if(ranking.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
Diff.mutations.queue(() => {
|
||||
element.textContent = "#" + ranking
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
colorStripes() {
|
||||
if(!this.app.currentPath.includes("/explore/color/")) {
|
||||
return
|
||||
|
Reference in New Issue
Block a user