Fix print view for votes (transposed) report

This commit is contained in:
RunasSudo 2021-09-26 02:25:44 +10:00
parent 3a4e53e1f0
commit 2f7abf9f0a
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -366,7 +366,10 @@ async function printResult() {
break; break;
} }
if (document.getElementById('selReport').value === 'ballots_votes' && endCol + 1 < modelRow.length) { if (
(document.getElementById('selReport').value === 'ballots_votes' && endCol + 1 < modelRow.length) ||
(document.getElementById('selReport').value === 'votes_transposed' && endCol != 1 && endCol + 1 < modelRow.length)
) {
// Check second column // Check second column
if (totalWidth + modelRow[endCol].clientWidth + modelRow[endCol + 1].clientWidth > printableWidth) { if (totalWidth + modelRow[endCol].clientWidth + modelRow[endCol + 1].clientWidth > printableWidth) {
break; break;
@ -377,7 +380,10 @@ async function printResult() {
totalWidth += modelRow[endCol].clientWidth; totalWidth += modelRow[endCol].clientWidth;
endCol++; endCol++;
if (document.getElementById('selReport').value === 'ballots_votes' && endCol < modelRow.length) { if (
(document.getElementById('selReport').value === 'ballots_votes' && endCol < modelRow.length) ||
(document.getElementById('selReport').value === 'votes_transposed' && endCol != 2 && endCol + 1 < modelRow.length)
) {
// Second column // Second column
totalWidth += modelRow[endCol].clientWidth; totalWidth += modelRow[endCol].clientWidth;
endCol++; endCol++;