jellyfin-web/dashboard-ui/scripts/channelslatest.js

37 lines
854 B
JavaScript
Raw Normal View History

(function ($, document) {
2014-06-17 09:03:14 -07:00
function reloadItems(page) {
2015-07-19 20:43:13 -07:00
Dashboard.showLoadingMsg();
2015-12-14 08:43:03 -07:00
Sections.loadLatestChannelItems(page.querySelector('.latestItems'), Dashboard.getCurrentUserId()).then(function() {
Dashboard.hideLoadingMsg();
}, function () {
2015-07-19 20:43:13 -07:00
Dashboard.hideLoadingMsg();
});
}
2015-07-18 11:07:03 -07:00
function loadTab(page, index) {
2015-07-18 11:07:03 -07:00
switch (index) {
case 0:
reloadItems(page);
break;
default:
break;
}
}
2015-12-14 08:43:03 -07:00
pageIdOn('pageinit', "channelsPage", function () {
2015-07-18 11:07:03 -07:00
var page = this;
var pages = page.querySelector('neon-animated-pages');
2015-12-14 08:43:03 -07:00
pages.addEventListener('tabchange', function (e) {
loadTab(page, parseInt(e.target.selected));
2015-07-18 11:07:03 -07:00
});
});
})(jQuery, document);