add a book count
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-02-04 20:51:40 -05:00
parent f802943316
commit b11316abe5
3 changed files with 9 additions and 0 deletions

View File

@@ -39,6 +39,9 @@ function renderTable(books, sortField) {
var bookElement = document.getElementById("books");
bookElement.innerHTML = TableTemplate(books);
var bookCount = document.getElementById("bookCount");
bookCount.innerHTML = `${books.length} books`;
// add listeners for selecting book to view
Array.from(bookElement.querySelectorAll("tbody tr"))
.slice(1) // remove header from Array