Show total pages count (#164)

* Update pages.js

* show x of y pages found when showing partial results

---------
Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
This commit is contained in:
Matteo Cargnelutti
2023-04-06 10:10:26 -07:00
committed by GitHub
co-authored by Ilya Kreymer
parent 02631740d4
commit 6a24be439c
+11
View File
@@ -853,6 +853,17 @@ class Pages extends LitElement
} }
formatResults() { formatResults() {
// Default behavior: Count all available pages
if (!this.query) {
const length = this.collInfo.pages.length;
if (length === this.sortedPages.length) {
return `${length} Page${length ? "s" : ""} Found`;
} else {
return `${this.sortedPages.length} of ${length} Pages Found`;
}
}
// ... unless they were filtered
if (this.sortedPages.length === 1) { if (this.sortedPages.length === 1) {
return "1 Page Found"; return "1 Page Found";
} else { } else {