Add auto scroll top when using paging

This commit is contained in:
Dmitry Lyzo 2022-01-16 18:55:48 +03:00
parent 82dbfce374
commit df0da76312

View File

@ -50,7 +50,9 @@ export default function (view, params, tabContent) {
if (userSettings.libraryPageSize() > 0) {
query.StartIndex += query.Limit;
}
reloadItems(context);
reloadItems(context).then(() => {
window.scrollTo(0, 0);
});
}
function onPreviousPageClick() {
@ -61,7 +63,9 @@ export default function (view, params, tabContent) {
if (userSettings.libraryPageSize() > 0) {
query.StartIndex = Math.max(0, query.StartIndex - query.Limit);
}
reloadItems(context);
reloadItems(context).then(() => {
window.scrollTo(0, 0);
});
}
const query = getQuery();
@ -114,7 +118,7 @@ export default function (view, params, tabContent) {
const query = getQuery();
const apiClient = ApiClient;
query.UserId = apiClient.getCurrentUserId();
apiClient.getLiveTvChannels(query).then(function (result) {
return apiClient.getLiveTvChannels(query).then(function (result) {
renderChannels(context, result);
loading.hide();
isLoading = false;