mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
37 lines
866 B
JavaScript
37 lines
866 B
JavaScript
define([], function () {
|
|
|
|
function reloadItems(page) {
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
Sections.loadLatestChannelItems(page.querySelector('.latestItems'), Dashboard.getCurrentUserId()).then(function() {
|
|
Dashboard.hideLoadingMsg();
|
|
}, function () {
|
|
Dashboard.hideLoadingMsg();
|
|
});
|
|
}
|
|
|
|
function loadTab(page, index) {
|
|
|
|
switch (index) {
|
|
|
|
case 0:
|
|
reloadItems(page);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
pageIdOn('pageinit', "channelsPage", function () {
|
|
|
|
var page = this;
|
|
var pageTabsContainer = page.querySelector('.pageTabsContainer');
|
|
|
|
pageTabsContainer.addEventListener('tabchange', function (e) {
|
|
loadTab(page, parseInt(e.detail.selectedTabIndex));
|
|
});
|
|
|
|
});
|
|
|
|
}); |