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

37 lines
915 B
JavaScript
Raw Normal View History

2014-10-15 20:26:39 -07:00
(function ($, document) {
2014-06-23 09:05:19 -07:00
function loadSections(page, userId) {
var i, length;
var sectionCount = 3;
var elem = $('.sections', page);
if (!elem.html().length) {
var html = '';
for (i = 0, length = sectionCount; i < length; i++) {
html += '<div class="homePageSection section' + i + '"></div>';
}
elem.html(html);
}
2014-09-29 21:47:30 -07:00
var context = 'home-latest';
Sections.loadRecentlyAdded($('.section0', page), userId, context);
2014-06-23 09:05:19 -07:00
Sections.loadLatestLiveTvRecordings($(".section1", page), userId);
Sections.loadLatestChannelItems($(".section2", page), userId);
}
$(document).on('pagebeforeshow', "#homeLatestPage", function () {
var page = this;
var userId = Dashboard.getCurrentUserId();
loadSections(page, userId);
});
2014-10-15 20:26:39 -07:00
})(jQuery, document);