1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Simplify logic

This commit is contained in:
h3llrais3r 2022-12-13 21:26:28 +01:00 committed by Bill Thornton
parent 53aaa35a3b
commit b019eef37b
2 changed files with 22 additions and 37 deletions

View file

@ -69,13 +69,12 @@ const Pagination: FC<PaginationProps> = ({ viewQuerySettings, setViewQuerySettin
return (
<div ref={element}>
<div className='paging'>
{showControls && (
<div className='listPaging' style={{ display: 'flex', alignItems: 'center' }}>
<span>
{globalize.translate('ListPaging', (totalRecordCount ? startIndex + 1 : 0), recordsEnd, totalRecordCount)}
{globalize.translate('ListPaging', (totalRecordCount ? startIndex + 1 : 0), recordsEnd || totalRecordCount, totalRecordCount)}
</span>
{showControls && (
<div style={{ display: 'inline-flex' }}>
<IconButtonElement
is='paper-icon-button-light'
className='btnPreviousPage autoSize'
@ -88,15 +87,7 @@ const Pagination: FC<PaginationProps> = ({ viewQuerySettings, setViewQuerySettin
/>
</div>
)}
{!showControls && (
<div className='listPaging' style={{ display: 'flex', alignItems: 'center' }}>
<span>
{globalize.translate('ListPaging', (totalRecordCount ? startIndex + 1 : 0), totalRecordCount, totalRecordCount)}
</span>
</div>
)}
</div>
</div>
);

View file

@ -86,15 +86,9 @@ export function getQueryPagingHtml (options) {
html += '<div class="listPaging">';
if (showControls) {
html += '<span style="vertical-align:middle;">';
html += globalize.translate('ListPaging', totalRecordCount ? startIndex + 1 : 0, recordsEnd, totalRecordCount);
html += globalize.translate('ListPaging', totalRecordCount ? startIndex + 1 : 0, recordsEnd || totalRecordCount, totalRecordCount);
html += '</span>';
} else {
html += '<span style="vertical-align:middle;">';
html += globalize.translate('ListPaging', totalRecordCount ? startIndex + 1 : 0, totalRecordCount, totalRecordCount);
html += '</span>';
}
if (showControls || options.viewButton || options.filterButton || options.sortButton || options.addLayoutButton) {
html += '<div style="display:inline-block;">';