From 6a24be439c4bd0eb0aabae87ac8e76e098a05c2e Mon Sep 17 00:00:00 2001 From: Matteo Cargnelutti Date: Thu, 6 Apr 2023 13:10:26 -0400 Subject: [PATCH] Show total pages count (#164) * Update pages.js * show x of y pages found when showing partial results --------- Co-authored-by: Ilya Kreymer --- src/pages.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pages.js b/src/pages.js index ff211ab..0f4cf64 100644 --- a/src/pages.js +++ b/src/pages.js @@ -853,6 +853,17 @@ class Pages extends LitElement } 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) { return "1 Page Found"; } else {