jellyfin-web/dashboard-ui/scripts/channelslatest.js
2015-07-19 23:43:13 -04:00

35 lines
789 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('pageinitdepends', "#channelsPage", function () {
var page = this;
var pages = page.querySelector('neon-animated-pages');
$(pages).on('tabchange', function () {
loadTab(page, parseInt(this.selected));
});
});
})(jQuery, document);