jellyfin-web/dashboard-ui/scripts/channelslatest.js
Luke Pulverenti 88d6c63263 use strict
2016-10-23 01:11:46 -04:00

38 lines
861 B
JavaScript

define([], function () {
'use strict';
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 mdlTabs = page.querySelector('.libraryViewNav');
mdlTabs.addEventListener('tabchange', function (e) {
loadTab(page, parseInt(e.detail.selectedTabIndex));
});
});
});