Remove results div

This commit is contained in:
Lavender 2021-04-05 11:36:04 -07:00
parent 24f9d89fec
commit 6190157b2f
Signed by untrusted user: endie
GPG key ID: CC5162D7C2146F01
2 changed files with 2 additions and 6 deletions

View file

@ -9,8 +9,6 @@
<h1 id="progress"> <h1 id="progress">
Loading... Loading...
</h1> </h1>
<div id="results">
</div>
<h1> <h1>
Source code: Source code:
<a href="https://gitdab.com/endie/team-big"> <a href="https://gitdab.com/endie/team-big">

View file

@ -10,14 +10,12 @@ request.onload = function() {
let teams = JSON.parse(this.response) let teams = JSON.parse(this.response)
let totals = teams.map(team => team.lineup.length + team.rotation.length) let totals = teams.map(team => team.lineup.length + team.rotation.length)
let results = document.getElementById("results")
// Get all player counts that there are from greatest to least // Get all player counts that there are from greatest to least
// & make headers & lists for them // & make headers & lists for them
totals.slice().sort((x, y) => y - x) totals.slice().sort((x, y) => x - y)
.filter((item, pos, array) => !pos || item !== array[pos - 1]) .filter((item, pos, array) => !pos || item !== array[pos - 1])
.forEach(function(item) { .forEach(function(item) {
results.insertAdjacentHTML("beforeend", document.body.insertAdjacentHTML("afterbegin",
`<h1>${item} player${ending(item)}</h1> `<h1>${item} player${ending(item)}</h1>
<ul id="tlist${item}"></ul>`) <ul id="tlist${item}"></ul>`)
}) })