2014-02-22 22:52:30 -07:00
|
|
|
|
(function ($, document) {
|
|
|
|
|
|
|
|
|
|
$(document).on('pagebeforeshow', "#tvNextUpPage", function () {
|
|
|
|
|
|
|
|
|
|
var screenWidth = $(window).width();
|
2014-07-04 22:21:13 -07:00
|
|
|
|
var userId = Dashboard.getCurrentUserId();
|
2014-02-22 22:52:30 -07:00
|
|
|
|
|
2014-05-01 19:54:33 -07:00
|
|
|
|
var parentId = LibraryMenu.getTopParentId();
|
|
|
|
|
|
2014-02-22 22:52:30 -07:00
|
|
|
|
var page = this;
|
|
|
|
|
|
|
|
|
|
var options = {
|
|
|
|
|
|
|
|
|
|
IncludeItemTypes: "Episode",
|
2014-07-17 15:21:35 -07:00
|
|
|
|
Limit: screenWidth >= 1600 ? 24 : (screenWidth >= 1440 ? 16 : 15),
|
2014-07-04 22:21:13 -07:00
|
|
|
|
Fields: "PrimaryImageAspectRatio",
|
|
|
|
|
ParentId: parentId,
|
|
|
|
|
IsPlayed: false
|
2014-02-22 22:52:30 -07:00
|
|
|
|
};
|
|
|
|
|
|
2014-07-04 22:21:13 -07:00
|
|
|
|
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
2014-02-22 22:52:30 -07:00
|
|
|
|
|
|
|
|
|
$('#latestEpisodes', page).html(LibraryBrowser.getPosterViewHtml({
|
2014-07-04 22:21:13 -07:00
|
|
|
|
items: items,
|
2014-08-01 19:34:45 -07:00
|
|
|
|
shape: "homePageBackdrop",
|
2014-07-04 22:21:13 -07:00
|
|
|
|
preferThumb: true,
|
|
|
|
|
inheritThumb: false,
|
2014-07-15 12:16:16 -07:00
|
|
|
|
showParentTitle: false,
|
2014-07-04 22:21:13 -07:00
|
|
|
|
showUnplayedIndicator: false,
|
|
|
|
|
showChildCountIndicator: true,
|
|
|
|
|
overlayText: screenWidth >= 600,
|
|
|
|
|
lazy: true
|
2014-02-22 22:52:30 -07:00
|
|
|
|
|
2014-08-01 19:34:45 -07:00
|
|
|
|
})).trigger('create').createCardMenus();
|
2014-02-22 22:52:30 -07:00
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})(jQuery, document);
|