2014-03-11 19:11:01 -07:00
|
|
|
|
(function ($, document) {
|
|
|
|
|
|
|
|
|
|
$(document).on('pagebeforeshow', "#moviesLatestPage", function () {
|
|
|
|
|
|
2014-05-01 19:54:33 -07:00
|
|
|
|
var parentId = LibraryMenu.getTopParentId();
|
2014-07-04 22:21:13 -07:00
|
|
|
|
var userId = Dashboard.getCurrentUserId();
|
|
|
|
|
|
2014-03-11 19:11:01 -07:00
|
|
|
|
var screenWidth = $(window).width();
|
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
|
|
|
|
var options = {
|
|
|
|
|
|
|
|
|
|
IncludeItemTypes: "Movie",
|
2014-07-17 15:21:35 -07:00
|
|
|
|
Limit: screenWidth >= 1600 ? 28 : (screenWidth >= 1440 ? 30 : (screenWidth >= 800 ? 28 : 18)),
|
2014-03-11 19:11:01 -07:00
|
|
|
|
Fields: "PrimaryImageAspectRatio",
|
2014-07-04 22:21:13 -07:00
|
|
|
|
ParentId: parentId,
|
|
|
|
|
IsPlayed: false
|
2014-03-11 19:11:01 -07:00
|
|
|
|
};
|
|
|
|
|
|
2014-07-04 22:21:13 -07:00
|
|
|
|
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
2014-03-11 19:11:01 -07:00
|
|
|
|
|
|
|
|
|
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
2014-07-04 22:21:13 -07:00
|
|
|
|
items: items,
|
2014-08-01 19:34:45 -07:00
|
|
|
|
lazy: true,
|
|
|
|
|
shape: 'homePagePortrait',
|
|
|
|
|
overlayText: true
|
2014-03-11 19:11:01 -07:00
|
|
|
|
|
2014-08-01 19:34:45 -07:00
|
|
|
|
})).trigger('create').createCardMenus();
|
2014-03-11 19:11:01 -07:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})(jQuery, document);
|