Skip to content

Commit

Permalink
Marked teams as picked on pivot by clicking team number
Browse files Browse the repository at this point in the history
  • Loading branch information
fruzyna committed Mar 21, 2024
1 parent 42b45ec commit f535695
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/pivot.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,23 @@ function build_table(sort_by=0, reverse=false, moved_idx=-1, placed_idx=-1)
let team_num = row.insertCell()
team_num.innerText = team
team_num.title = dal.get_value(team, 'meta.name')
team_num.onclick = (event) => {
if (!Object.keys(dal.picklists).includes('picked'))
{
dal.picklists.picked = []
}
if (dal.picklists.picked.includes(team))
{
let pos = dal.picklists.picked.indexOf(team)
dal.picklists.picked.splice(pos, 1)
}
else
{
dal.picklists.picked.push(team)
}
dal.save_picklists()
build_table(sort_by, reverse, moved_idx, placed_idx)
}
if (dal.is_unsure(team))
{
team_num.classList.add('highlighted')
Expand Down

0 comments on commit f535695

Please sign in to comment.