mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix pagination to negative pages bug
This commit is contained in:
parent
58ea56f9d1
commit
cba0968358
9 changed files with 129 additions and 45 deletions
|
@ -30,10 +30,12 @@ define(["cardBuilder", "imageLoader", "libraryBrowser", "loading", "events", "em
|
|||
|
||||
function renderChannels(context, result) {
|
||||
function onNextPageClick() {
|
||||
if (isLoading) return;
|
||||
query.StartIndex += query.Limit, reloadItems(context)
|
||||
}
|
||||
|
||||
function onPreviousPageClick() {
|
||||
if (isLoading) return;
|
||||
query.StartIndex -= query.Limit, reloadItems(context)
|
||||
}
|
||||
var query = getQuery();
|
||||
|
@ -68,17 +70,20 @@ define(["cardBuilder", "imageLoader", "libraryBrowser", "loading", "events", "em
|
|||
|
||||
function reloadItems(context, save) {
|
||||
loading.show();
|
||||
isLoading = true;
|
||||
var query = getQuery(),
|
||||
apiClient = ApiClient;
|
||||
query.UserId = apiClient.getCurrentUserId(), apiClient.getLiveTvChannels(query).then(function(result) {
|
||||
renderChannels(context, result), loading.hide()
|
||||
renderChannels(context, result);
|
||||
loading.hide();
|
||||
isLoading = false;
|
||||
})
|
||||
}
|
||||
var pageData, self = this;
|
||||
var pageData, self = this, isLoading = false;
|
||||
tabContent.querySelector(".btnFilter").addEventListener("click", function() {
|
||||
showFilterMenu(tabContent)
|
||||
}), self.renderTab = function() {
|
||||
reloadItems(tabContent)
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue