Hide loss to fraction in JS report if all zero
This commit is contained in:
parent
d5db9b5df6
commit
80f6555e53
@ -250,8 +250,10 @@ async function clickCount() {
|
|||||||
// Loss to fraction row
|
// Loss to fraction row
|
||||||
trLTF1 = document.createElement('tr');
|
trLTF1 = document.createElement('tr');
|
||||||
trLTF1.classList.add('info');
|
trLTF1.classList.add('info');
|
||||||
|
trLTF1.style.display = 'none';
|
||||||
trLTF2 = document.createElement('tr');
|
trLTF2 = document.createElement('tr');
|
||||||
trLTF2.classList.add('info');
|
trLTF2.classList.add('info');
|
||||||
|
trLTF2.style.display = 'none';
|
||||||
|
|
||||||
elTd = document.createElement('td');
|
elTd = document.createElement('td');
|
||||||
elTd.setAttribute('rowspan', '2');
|
elTd.setAttribute('rowspan', '2');
|
||||||
@ -388,9 +390,15 @@ async function clickCount() {
|
|||||||
|
|
||||||
elTd = document.createElement('td');
|
elTd = document.createElement('td');
|
||||||
elTd.classList.add('count');
|
elTd.classList.add('count');
|
||||||
elTd.innerHTML = ppVotes(result.loss_fraction.votes);
|
let ppLTF = ppVotes(result.loss_fraction.votes);
|
||||||
|
elTd.innerHTML = ppLTF;
|
||||||
trLTF2.appendChild(elTd);
|
trLTF2.appendChild(elTd);
|
||||||
|
|
||||||
|
if (ppLTF !== ' ') {
|
||||||
|
trLTF1.style.display = 'table-row';
|
||||||
|
trLTF2.style.display = 'table-row';
|
||||||
|
}
|
||||||
|
|
||||||
// Display total
|
// Display total
|
||||||
elTd = document.createElement('td');
|
elTd = document.createElement('td');
|
||||||
elTd.classList.add('count');
|
elTd.classList.add('count');
|
||||||
|
Reference in New Issue
Block a user