Highlight names of elected candidates in web UI

This commit is contained in:
RunasSudo 2021-06-05 23:29:31 +10:00
parent de7a2ad20c
commit baec51bd35
No known key found for this signature in database
GPG Key ID: 7234E476BF21C61A

View File

@ -48,7 +48,18 @@ worker.onmessage = function(evt) {
} else if (evt.data.type === 'updateResultsTable') {
for (let i = 0; i < evt.data.result.length; i++) {
tblResult.rows[i].insertAdjacentHTML('beforeend', evt.data.result[i]);
if (evt.data.result[i]) {
tblResult.rows[i].insertAdjacentHTML('beforeend', evt.data.result[i]);
// Update candidate status
if (i >= 3 && i % 2 == 1) {
if (tblResult.rows[i].lastElementChild.classList.contains('elected')) {
tblResult.rows[i].cells[0].classList.add('elected');
} else {
tblResult.rows[i].cells[0].classList.remove('elected');
}
}
}
}
} else if (evt.data.type === 'updateStageComments') {