From 53aaa35a3b2eb947f1e934501751e0e0f4a64556 Mon Sep 17 00:00:00 2001 From: h3llrais3r Date: Sun, 11 Dec 2022 18:38:47 +0100 Subject: [PATCH] Show total count when no pagination is applied If no pagination is applied (or disabled in the settings), there is no view on how many items you have in your library. By showing the pagination text (without the pagination buttons) it's still visible for the user how many items are listed in the library. --- src/components/common/Pagination.tsx | 9 +++++++++ src/scripts/libraryBrowser.js | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/components/common/Pagination.tsx b/src/components/common/Pagination.tsx index 1c0e9de2a2..79d632abee 100644 --- a/src/components/common/Pagination.tsx +++ b/src/components/common/Pagination.tsx @@ -88,6 +88,15 @@ const Pagination: FC = ({ viewQuerySettings, setViewQuerySettin /> )} + {!showControls && ( +
+ + + {globalize.translate('ListPaging', (totalRecordCount ? startIndex + 1 : 0), totalRecordCount, totalRecordCount)} + + +
+ )} ); diff --git a/src/scripts/libraryBrowser.js b/src/scripts/libraryBrowser.js index eaec777401..5ad69fb85e 100644 --- a/src/scripts/libraryBrowser.js +++ b/src/scripts/libraryBrowser.js @@ -90,6 +90,10 @@ export function getQueryPagingHtml (options) { html += ''; html += globalize.translate('ListPaging', totalRecordCount ? startIndex + 1 : 0, recordsEnd, totalRecordCount); html += ''; + } else { + html += ''; + html += globalize.translate('ListPaging', totalRecordCount ? startIndex + 1 : 0, totalRecordCount, totalRecordCount); + html += ''; } if (showControls || options.viewButton || options.filterButton || options.sortButton || options.addLayoutButton) {