mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update tab loading
This commit is contained in:
parent
dc90abdf0f
commit
94fd632dd3
11 changed files with 225 additions and 49 deletions
|
@ -1,6 +1,6 @@
|
|||
define(['datetime', 'scrollStyles'], function (datetime) {
|
||||
|
||||
function loadUpcoming(context, params) {
|
||||
function getUpcomingPromise(context, params) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -16,7 +16,12 @@
|
|||
|
||||
query.ParentId = params.topParentId;
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Shows/Upcoming", query)).then(function (result) {
|
||||
return ApiClient.getJSON(ApiClient.getUrl("Shows/Upcoming", query));
|
||||
}
|
||||
|
||||
function loadUpcoming(context, params, promise) {
|
||||
|
||||
promise.then(function (result) {
|
||||
|
||||
var items = result.Items;
|
||||
|
||||
|
@ -126,11 +131,16 @@
|
|||
}
|
||||
return function (view, params, tabContent) {
|
||||
|
||||
var self = this;
|
||||
var self = this;
|
||||
var upcomingPromise;
|
||||
|
||||
self.preRender = function () {
|
||||
upcomingPromise = getUpcomingPromise(view, params);
|
||||
};
|
||||
|
||||
self.renderTab = function () {
|
||||
|
||||
loadUpcoming(tabContent, params);
|
||||
loadUpcoming(tabContent, params, upcomingPromise);
|
||||
};
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue