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

Merge pull request #3360 from dmitrylyzo/show-alphapicker

Show AlphaPicker if there is SortName
This commit is contained in:
Bill Thornton 2022-02-13 00:54:15 -05:00 committed by GitHub
commit e4b7952e9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View file

@ -217,18 +217,14 @@ import { appRouter } from '../components/appRouter';
}
}
function updateAlphaPickerState(instance, numItems) {
function updateAlphaPickerState(instance) {
if (instance.alphaPicker) {
const alphaPicker = instance.alphaPickerElement;
if (alphaPicker) {
const values = instance.getSortValues();
if (numItems == null) {
numItems = 100;
}
if (values.sortBy === 'SortName' && values.sortOrder === 'Ascending' && numItems > 40) {
if (values.sortBy.indexOf('SortName') !== -1) {
alphaPicker.classList.remove('hide');
instance.itemsContainer.parentNode.classList.add('padded-right-withalphapicker');
} else {
@ -494,7 +490,7 @@ class ItemsView {
self.totalItemCount = result.Items ? result.Items.length : result.length;
}
updateAlphaPickerState(self, self.totalItemCount);
updateAlphaPickerState(self);
updatePaging(result.StartIndex, result.TotalRecordCount, query.Limit);
return result;
}).finally(() => {