From 2f7abf9f0a6ca94d7ac9050f1e45b9acbcb2baa8 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 26 Sep 2021 02:25:44 +1000 Subject: [PATCH] Fix print view for votes (transposed) report --- html/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/html/index.js b/html/index.js index 33560b6..b9a3087 100644 --- a/html/index.js +++ b/html/index.js @@ -366,7 +366,10 @@ async function printResult() { 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 if (totalWidth + modelRow[endCol].clientWidth + modelRow[endCol + 1].clientWidth > printableWidth) { break; @@ -377,7 +380,10 @@ async function printResult() { totalWidth += modelRow[endCol].clientWidth; 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 totalWidth += modelRow[endCol].clientWidth; endCol++;