mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #3342 from dmitrylyzo/livetv-paging
Fix LiveTV Channels paging and autofocus
This commit is contained in:
commit
c2629b5c3f
2 changed files with 23 additions and 12 deletions
|
@ -64,6 +64,9 @@
|
||||||
<button is="paper-icon-button-light" class="btnFilter sectionTitleButton" title="${Filter}"><span class="material-icons filter_list"></span></button>
|
<button is="paper-icon-button-light" class="btnFilter sectionTitleButton" title="${Filter}"><span class="material-icons filter_list"></span></button>
|
||||||
</div>
|
</div>
|
||||||
<div is="emby-itemscontainer" id="items" class="itemsContainer vertical-wrap padded-left padded-right"></div>
|
<div is="emby-itemscontainer" id="items" class="itemsContainer vertical-wrap padded-left padded-right"></div>
|
||||||
|
<div class="flex align-items-center justify-content-center flex-wrap-wrap padded-top padded-left padded-right padded-bottom focuscontainer-x">
|
||||||
|
<div class="paging"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pageTabContent" id="recordingsTab" data-index="3">
|
<div class="pageTabContent" id="recordingsTab" data-index="3">
|
||||||
<div id="latestRecordings" class="verticalSection hide">
|
<div id="latestRecordings" class="verticalSection hide">
|
||||||
|
|
|
@ -50,7 +50,9 @@ export default function (view, params, tabContent) {
|
||||||
if (userSettings.libraryPageSize() > 0) {
|
if (userSettings.libraryPageSize() > 0) {
|
||||||
query.StartIndex += query.Limit;
|
query.StartIndex += query.Limit;
|
||||||
}
|
}
|
||||||
reloadItems(context);
|
reloadItems(context).then(() => {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPreviousPageClick() {
|
function onPreviousPageClick() {
|
||||||
|
@ -61,11 +63,15 @@ export default function (view, params, tabContent) {
|
||||||
if (userSettings.libraryPageSize() > 0) {
|
if (userSettings.libraryPageSize() > 0) {
|
||||||
query.StartIndex = Math.max(0, query.StartIndex - query.Limit);
|
query.StartIndex = Math.max(0, query.StartIndex - query.Limit);
|
||||||
}
|
}
|
||||||
reloadItems(context);
|
reloadItems(context).then(() => {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const query = getQuery();
|
const query = getQuery();
|
||||||
context.querySelector('.paging').innerHTML = libraryBrowser.getQueryPagingHtml({
|
|
||||||
|
for (const elem of context.querySelectorAll('.paging')) {
|
||||||
|
elem.innerHTML = libraryBrowser.getQueryPagingHtml({
|
||||||
startIndex: query.StartIndex,
|
startIndex: query.StartIndex,
|
||||||
limit: query.Limit,
|
limit: query.Limit,
|
||||||
totalRecordCount: result.TotalRecordCount,
|
totalRecordCount: result.TotalRecordCount,
|
||||||
|
@ -73,6 +79,8 @@ export default function (view, params, tabContent) {
|
||||||
updatePageSizeSetting: false,
|
updatePageSizeSetting: false,
|
||||||
filterButton: false
|
filterButton: false
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const html = getChannelsHtml(result.Items);
|
const html = getChannelsHtml(result.Items);
|
||||||
const elem = context.querySelector('#items');
|
const elem = context.querySelector('#items');
|
||||||
elem.innerHTML = html;
|
elem.innerHTML = html;
|
||||||
|
@ -110,13 +118,13 @@ export default function (view, params, tabContent) {
|
||||||
const query = getQuery();
|
const query = getQuery();
|
||||||
const apiClient = ApiClient;
|
const apiClient = ApiClient;
|
||||||
query.UserId = apiClient.getCurrentUserId();
|
query.UserId = apiClient.getCurrentUserId();
|
||||||
apiClient.getLiveTvChannels(query).then(function (result) {
|
return apiClient.getLiveTvChannels(query).then(function (result) {
|
||||||
renderChannels(context, result);
|
renderChannels(context, result);
|
||||||
loading.hide();
|
loading.hide();
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|
||||||
import('../../components/autoFocuser').then(({default: autoFocuser}) => {
|
import('../../components/autoFocuser').then(({default: autoFocuser}) => {
|
||||||
autoFocuser.autoFocus(view);
|
autoFocuser.autoFocus(context);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue