Hide loss to fraction in JS report if all zero

This commit is contained in:
RunasSudo 2021-01-15 16:23:10 +11:00
parent d5db9b5df6
commit 80f6555e53
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -250,8 +250,10 @@ async function clickCount() {
// Loss to fraction row
trLTF1 = document.createElement('tr');
trLTF1.classList.add('info');
trLTF1.style.display = 'none';
trLTF2 = document.createElement('tr');
trLTF2.classList.add('info');
trLTF2.style.display = 'none';
elTd = document.createElement('td');
elTd.setAttribute('rowspan', '2');
@ -388,9 +390,15 @@ async function clickCount() {
elTd = document.createElement('td');
elTd.classList.add('count');
elTd.innerHTML = ppVotes(result.loss_fraction.votes);
let ppLTF = ppVotes(result.loss_fraction.votes);
elTd.innerHTML = ppLTF;
trLTF2.appendChild(elTd);
if (ppLTF !== ' ') {
trLTF1.style.display = 'table-row';
trLTF2.style.display = 'table-row';
}
// Display total
elTd = document.createElement('td');
elTd.classList.add('count');