Reset candidate green background when reset in Wright STV
This commit is contained in:
parent
77d773605a
commit
356509a4fe
@ -185,20 +185,25 @@ async function clickCount() {
|
||||
|
||||
elTd = document.createElement('td');
|
||||
elTd.classList.add('count');
|
||||
|
||||
if (countCard.state === py.pyRCV2.model.CandidateState.ELECTED || countCard.state === py.pyRCV2.model.CandidateState.PROVISIONALLY_ELECTED) {
|
||||
elTd.classList.add('elected');
|
||||
elTd.innerText = countCard.votes;
|
||||
elTr1.querySelector('td:first-child').classList.add('elected');
|
||||
} else {
|
||||
elTr1.querySelector('td:first-child').classList.remove('elected');
|
||||
|
||||
if (countCard.state === py.pyRCV2.model.CandidateState.WITHDRAWN) {
|
||||
elTd.classList.add('excluded');
|
||||
elTd.innerText = 'WD';
|
||||
} else if (countCard.state === py.pyRCV2.model.CandidateState.ELECTED || countCard.state === py.pyRCV2.model.CandidateState.PROVISIONALLY_ELECTED) {
|
||||
elTd.classList.add('elected');
|
||||
elTd.innerText = countCard.votes;
|
||||
|
||||
elTr1.querySelector('td:first-child').classList.add('elected');
|
||||
} else if (countCard.state === py.pyRCV2.model.CandidateState.EXCLUDED) {
|
||||
elTd.classList.add('excluded');
|
||||
elTd.innerText = 'EX';
|
||||
} else {
|
||||
elTd.innerText = countCard.votes;
|
||||
}
|
||||
}
|
||||
|
||||
elTr2.appendChild(elTd);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user