mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Show AlphaPicker in ListView if there is SortName
This commit is contained in:
parent
8a384f585d
commit
e55042d652
1 changed files with 3 additions and 7 deletions
|
@ -217,18 +217,14 @@ import { appRouter } from '../components/appRouter';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateAlphaPickerState(instance, numItems) {
|
function updateAlphaPickerState(instance) {
|
||||||
if (instance.alphaPicker) {
|
if (instance.alphaPicker) {
|
||||||
const alphaPicker = instance.alphaPickerElement;
|
const alphaPicker = instance.alphaPickerElement;
|
||||||
|
|
||||||
if (alphaPicker) {
|
if (alphaPicker) {
|
||||||
const values = instance.getSortValues();
|
const values = instance.getSortValues();
|
||||||
|
|
||||||
if (numItems == null) {
|
if (values.sortBy.indexOf('SortName') !== -1) {
|
||||||
numItems = 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (values.sortBy === 'SortName' && values.sortOrder === 'Ascending' && numItems > 40) {
|
|
||||||
alphaPicker.classList.remove('hide');
|
alphaPicker.classList.remove('hide');
|
||||||
instance.itemsContainer.parentNode.classList.add('padded-right-withalphapicker');
|
instance.itemsContainer.parentNode.classList.add('padded-right-withalphapicker');
|
||||||
} else {
|
} else {
|
||||||
|
@ -494,7 +490,7 @@ class ItemsView {
|
||||||
self.totalItemCount = result.Items ? result.Items.length : result.length;
|
self.totalItemCount = result.Items ? result.Items.length : result.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAlphaPickerState(self, self.totalItemCount);
|
updateAlphaPickerState(self);
|
||||||
updatePaging(result.StartIndex, result.TotalRecordCount, query.Limit);
|
updatePaging(result.StartIndex, result.TotalRecordCount, query.Limit);
|
||||||
return result;
|
return result;
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue