diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2026-05-28 13:25:48 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2026-05-28 13:25:48 +0300 |
| commit | 3ba4ede4952059906a15d6a89a2648aa8aef676e (patch) | |
| tree | b8010df4fd2e28d11d0c979f16c3c476560c5d93 /src | |
| parent | 830ce716ae5658ff85ee85e55319896cbac0a878 (diff) | |
| download | the-epube-3ba4ede4952059906a15d6a89a2648aa8aef676e.tar.gz the-epube-3ba4ede4952059906a15d6a89a2648aa8aef676e.tar.xz | |
add page X of Y pill
Diffstat (limited to 'src')
| -rw-r--r-- | src/app.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/app.js b/src/app.js index c82a5db..e340727 100644 --- a/src/app.js +++ b/src/app.js @@ -577,6 +577,7 @@ class AppClass extends AppCommon { updateIndexPagination(data) { const prevLi = $(".pager .previous"); const nextLi = $(".pager .next"); + const pagerInfo = $(".pager .pager-info"); const prevParams = new URLSearchParams({ mode: this.index_mode, @@ -604,6 +605,13 @@ class AppClass extends AppCommon { nextLi.addClass("disabled"); nextLi.find("a").attr("href", "#"); } + + const limit = data.limit || 60; + const total = data.total || 0; + const currentPage = Math.floor(this.index_offset / limit) + 1; + const totalPages = limit > 0 ? Math.ceil(total / limit) : 1; + + pagerInfo.find("span").text(`Page ${currentPage} of ${totalPages}`); } escapeHtml(str) { |
