mirror of https://github.com/dirtbags/moth.git
Scoreboard: preserve category order
This commit is contained in:
parent
79cef80486
commit
e4a8883f27
|
@ -71,7 +71,6 @@ async function update() {
|
||||||
|
|
||||||
while (rankingsElement.firstChild) rankingsElement.firstChild.remove()
|
while (rankingsElement.firstChild) rankingsElement.firstChild.remove()
|
||||||
|
|
||||||
let sortedCategories = scores.SortedCategories()
|
|
||||||
let sortedTeamIDs = [...scores.TeamIDs]
|
let sortedTeamIDs = [...scores.TeamIDs]
|
||||||
sortedTeamIDs.sort((a, b) => scores.CyFiScore(a) - scores.CyFiScore(b))
|
sortedTeamIDs.sort((a, b) => scores.CyFiScore(a) - scores.CyFiScore(b))
|
||||||
sortedTeamIDs.reverse()
|
sortedTeamIDs.reverse()
|
||||||
|
@ -98,7 +97,7 @@ async function update() {
|
||||||
let block = row.appendChild(document.createElement("span"))
|
let block = row.appendChild(document.createElement("span"))
|
||||||
let points = scores.GetPoints(category, teamID)
|
let points = scores.GetPoints(category, teamID)
|
||||||
let width = MaxScoreWidth * score / topScore
|
let width = MaxScoreWidth * score / topScore
|
||||||
let categoryNumber = sortedCategories.indexOf(category)
|
let categoryNumber = [...scores.Categories].indexOf(category)
|
||||||
|
|
||||||
block.textContent = category
|
block.textContent = category
|
||||||
block.title = `${points} points`
|
block.title = `${points} points`
|
||||||
|
|
Loading…
Reference in New Issue