1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update card layouts

This commit is contained in:
Luke Pulverenti 2015-05-13 00:55:19 -04:00
parent 8f4f29888e
commit bb38230c23
46 changed files with 1086 additions and 332 deletions

View file

@ -1,5 +1,14 @@
(function ($, document) {
function getView() {
if (AppInfo.hasLowImageBandwidth) {
return 'ThumbCard';
}
return 'Thumb';
}
$(document).on('pagebeforeshow', "#tvNextUpPage", function () {
var userId = Dashboard.getCurrentUserId();
@ -8,9 +17,11 @@
var page = this;
var limit = AppInfo.hasLowImageBandwidth ?
20 :
30;
var limit = 30;
if (AppInfo.hasLowImageBandwidth) {
limit = 16;
}
var options = {
@ -24,18 +35,43 @@
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
$('#latestEpisodes', page).html(LibraryBrowser.getPosterViewHtml({
items: items,
shape: "backdrop",
preferThumb: true,
inheritThumb: false,
showParentTitle: false,
showUnplayedIndicator: false,
showChildCountIndicator: true,
overlayText: true,
lazy: true
var view = getView();
var html = '';
})).lazyChildren();
if (view == 'ThumbCard') {
html += LibraryBrowser.getPosterViewHtml({
items: items,
shape: "backdrop",
preferThumb: true,
inheritThumb: false,
showUnplayedIndicator: false,
showChildCountIndicator: true,
overlayText: false,
showParentTitle: true,
lazy: true,
showTitle: true,
cardLayout: true
});
} else if (view == 'Thumb') {
html += LibraryBrowser.getPosterViewHtml({
items: items,
shape: "backdrop",
preferThumb: true,
inheritThumb: false,
showParentTitle: false,
showUnplayedIndicator: false,
showChildCountIndicator: true,
overlayText: false,
centerText: true,
lazy: true,
showTitle: false
});
}
$('#latestEpisodes', page).html(html).lazyChildren();
});
});