Skip to content

Commit

Permalink
Fix off by one error
Browse files Browse the repository at this point in the history
  • Loading branch information
rakaramos committed Jan 23, 2021
1 parent 8d1d135 commit b58c3e8
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Sources/muterCore/TestReporting/HTML/HTMLShims.swift
Expand Up @@ -569,11 +569,23 @@ let javascript =
showFirstRows(rows, displayCount);
}
function showHide(shouldShow, tableId) {
var rows = Array.from(document.getElementById(tableId).tBodies[0].rows)
.filter(row => { return !isSnapshotRow(row); });
var displayCount = shouldShow ? rows.length : 10;
showFirstRows(rows, displayCount);
}
function showFirstRows(rows, count) {
rows.slice(1, count).forEach(row => { row.style.display = "table-row"; });
rows.slice(0, count).forEach(row => { row.style.display = "table-row"; });
const remeaning = Math.max(rows.length - count - 1, 0);
const remeaning = Math.max(rows.length - count - 1, 1);
rows.slice(-remeaning).forEach(row => { row.style.display = "none"; });
if (remeaning != 0) {
rows.slice(-remeaning).forEach(row => { row.style.display = "none"; });
}
}
function showChange(button) {
Expand Down

0 comments on commit b58c3e8

Please sign in to comment.