jellyfin-web/dashboard-ui/scripts/channelslatest.js
Luke Pulverenti 9ea282ff39 update tabs
2015-09-01 10:01:59 -04:00

35 lines
782 B
JavaScript

(function ($, document) {
function reloadItems(page) {
Dashboard.showLoadingMsg();
Sections.loadLatestChannelItems(page.querySelector('.latestItems'), Dashboard.getCurrentUserId()).always(function() {
Dashboard.hideLoadingMsg();
});
}
function loadTab(page, index) {
switch (index) {
case 0:
reloadItems(page);
break;
default:
break;
}
}
$(document).on('pageinit', "#channelsPage", function () {
var page = this;
var pages = page.querySelector('neon-animated-pages');
$(pages).on('tabchange', function () {
loadTab(page, parseInt(this.selected));
});
});
})(jQuery, document);