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,34 +69,25 @@ const Pagination: FC<PaginationProps> = ({ viewQuerySettings, setViewQuerySettin
return ( return (
<div ref={element}> <div ref={element}>
<div className='paging'> <div className='paging'>
{showControls && ( <div className='listPaging' style={{ display: 'flex', alignItems: 'center' }}>
<div className='listPaging' style={{ display: 'flex', alignItems: 'center' }}> <span>
{globalize.translate('ListPaging', (totalRecordCount ? startIndex + 1 : 0), recordsEnd || totalRecordCount, totalRecordCount)}
<span> </span>
{globalize.translate('ListPaging', (totalRecordCount ? startIndex + 1 : 0), recordsEnd, totalRecordCount)} {showControls && (
</span> <div style={{ display: 'inline-flex' }}>
<IconButtonElement
<IconButtonElement is='paper-icon-button-light'
is='paper-icon-button-light' className='btnPreviousPage autoSize'
className='btnPreviousPage autoSize' icon='material-icons arrow_back'
icon='material-icons arrow_back' />
/> <IconButtonElement
<IconButtonElement is='paper-icon-button-light'
is='paper-icon-button-light' className='btnNextPage autoSize'
className='btnNextPage autoSize' icon='material-icons arrow_forward'
icon='material-icons arrow_forward' />
/> </div>
</div> )}
)} </div>
{!showControls && (
<div className='listPaging' style={{ display: 'flex', alignItems: 'center' }}>
<span>
{globalize.translate('ListPaging', (totalRecordCount ? startIndex + 1 : 0), totalRecordCount, totalRecordCount)}
</span>
</div>
)}
</div> </div>
</div> </div>
); );

View file

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