Skip to content

Commit

Permalink
Gray out picked teams on pivot
Browse files Browse the repository at this point in the history
  • Loading branch information
fruzyna committed Mar 21, 2024
1 parent 7e552f8 commit e824844
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/pivot.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,12 @@ function build_table(sort_by=0, reverse=false, moved_idx=-1, placed_idx=-1)
sort_char = ' &#9660'
}

let picked_teams = []
if (Object.keys(dal.picklists).includes('picked'))
{
picked_teams = dal.picklists.picked
}

// build table headers
let table = document.createElement('table')

Expand Down Expand Up @@ -566,6 +572,10 @@ function build_table(sort_by=0, reverse=false, moved_idx=-1, placed_idx=-1)
{
team_num.classList.add('highlighted')
}
if (picked_teams.includes(team))
{
row.classList.add('faded')
}

for (let i in selected)
{
Expand All @@ -592,7 +602,7 @@ function build_table(sort_by=0, reverse=false, moved_idx=-1, placed_idx=-1)
mean = 0.5
}
let t = dal.meta[key].type
if (val !== mean && (type !== 'total' || (t !== 'select' || t === 'dropdown')))
if (!picked_teams.includes(team) && val !== mean && (type !== 'total' || (t !== 'select' || t === 'dropdown')))
{
let colors = [0,0,0,0]

Expand Down

0 comments on commit e824844

Please sign in to comment.