Merge pull request #106 from dirtbags/v3.4_hotfix

Made top-scoring teams full-width
This commit is contained in:
int00h5525 2019-11-20 18:31:35 -06:00 committed by GitHub
commit db290ca4f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [3.4.3] - 2019-11-20
### Fixed
- Made top-scoring teams full-width
## [3.4.2] - 2019-11-18
### Fixed
- Issue with multiple answers in devel server and YAML-format .moth

View File

@ -1 +1 @@
3.4.2
3.4.3

View File

@ -112,10 +112,14 @@ function scoreboardInit() {
winners.sort(teamCompare)
winners.reverse()
// Let's make some better names for things we've computed
let winningScore = winners[0].overallScore
let numCategories = Object.keys(highestCategoryScore).length
// Clear out the element we're about to populate
Array.from(element.childNodes).map(e => e.remove())
let maxWidth = 100 / Object.keys(highestCategoryScore).length
let maxWidth = 100 / winningScore
for (let team of winners) {
let row = document.createElement("div")
let ncat = 0
@ -125,8 +129,6 @@ function scoreboardInit() {
let catPct = catTeam / catHigh
let width = maxWidth * catPct
console.log(catHigh, catTeam, catPct)
let bar = document.createElement("span")
bar.classList.add("category")
bar.classList.add("cat" + ncat)