Skip to content

Commit

Permalink
better heading handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mart2070 committed Feb 3, 2025
1 parent 30eae62 commit b0891dc
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tdx-enhanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,17 @@
heading.appendChild(countSpan)
}

var countTxt
var countTxt = null

if (totalItems) {
countTxt = `${numItems} of ${totalItems} ${totalItems == 1 ? 'item' : 'items'}`
} else {
} else if (numItems) {
countTxt = `${numItems} ${numItems == 1 ? 'item' : 'items'}`
}

if (countTxt) {
countSpan.innerText = countTxt
}
}
}

Expand Down Expand Up @@ -350,6 +352,9 @@
let table = t.querySelector("table.report-viewer")
let items = [];

var numItems = null
var totalItems = null

if (table) {
let headers = [];
//console.log("Table",table);
Expand Down Expand Up @@ -388,8 +393,8 @@
})

//update panel heading above table
var numItems = items.length
var totalItems = null
numItems = items.length
//totalItems = null

let pagination = t.querySelector(".pull-right .bootstrap-pagination-label")
if (pagination) {
Expand All @@ -398,6 +403,10 @@
totalItems = pTxt
}


//console.log("Items:",items)
}

updateHeading(t.parentElement,numItems,totalItems)
}

Expand Down

0 comments on commit b0891dc

Please sign in to comment.