mirror of https://github.com/dirtbags/moth.git
scoreboard: category stays consistent color
This commit is contained in:
parent
62043919f5
commit
79cef80486
|
@ -71,6 +71,7 @@ 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()
|
||||||
|
@ -85,7 +86,6 @@ async function update() {
|
||||||
teamname.textContent = teamName
|
teamname.textContent = teamName
|
||||||
teamname.classList.add("teamname")
|
teamname.classList.add("teamname")
|
||||||
|
|
||||||
let categoryNumber = 0
|
|
||||||
let teampoints = row.appendChild(document.createElement("span"))
|
let teampoints = row.appendChild(document.createElement("span"))
|
||||||
teampoints.classList.add("teampoints")
|
teampoints.classList.add("teampoints")
|
||||||
for (let category of scores.Categories) {
|
for (let category of scores.Categories) {
|
||||||
|
@ -98,6 +98,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)
|
||||||
|
|
||||||
block.textContent = category
|
block.textContent = category
|
||||||
block.title = `${points} points`
|
block.title = `${points} points`
|
||||||
|
|
Loading…
Reference in New Issue