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

This commit is contained in:
David 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"); var bookElement = document.getElementById("books");
bookElement.innerHTML = TableTemplate(books); bookElement.innerHTML = TableTemplate(books);
var bookCount = document.getElementById("bookCount");
bookCount.innerHTML = `${books.length} books`;
// add listeners for selecting book to view // add listeners for selecting book to view
Array.from(bookElement.querySelectorAll("tbody tr")) Array.from(bookElement.querySelectorAll("tbody tr"))
.slice(1) // remove header from Array .slice(1) // remove header from Array

View File

@ -30,6 +30,7 @@
>git</a >git</a
> >
<div id="searchBox"> <div id="searchBox">
<span id="bookCount" class="bookCount">_ books</span>
<input <input
id="search" id="search"
type="text" type="text"

View File

@ -147,6 +147,11 @@ body {
display: inline; display: inline;
} }
#header .bookCount {
font-size: small;
color: #a29c77;
}
#searchBox { #searchBox {
position: absolute; position: absolute;
right: 10px; right: 10px;