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

update now playing

This commit is contained in:
Luke Pulverenti 2015-09-26 10:51:26 -04:00
parent ad38cf4783
commit b5a723314b
23 changed files with 229 additions and 66 deletions

View file

@ -633,6 +633,18 @@
});
}
function enableScrollX() {
return $.browser.mobile && AppInfo.enableAppLayouts;
}
function getPortraitShape() {
return enableScrollX() ? 'overflowPortrait' : 'detailPagePortrait';
}
function getSquareShape() {
return enableScrollX() ? 'overflowSquare' : 'detailPageSquare';
}
function renderSimilarItems(page, item, context) {
if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "Series" || item.Type == "Program" || item.Type == "Recording" || item.Type == "Game" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "ChannelVideoItem") {
@ -643,7 +655,7 @@
return;
}
var shape = item.Type == "MusicAlbum" || item.Type == "MusicArtist" ? "detailPageSquare" : "detailPagePortrait";
var shape = item.Type == "MusicAlbum" || item.Type == "MusicArtist" ? getSquareShape() : getPortraitShape();
var screenWidth = $(window).width();
var screenHeight = $(window).height();
@ -657,6 +669,10 @@
options.limit *= 2;
}
if (enableScrollX()) {
options.limit = 12;
}
ApiClient.getSimilarItems(item.Id, options).done(function (result) {
if (!result.Items.length) {
@ -669,7 +685,14 @@
$('.similiarHeader', elem).html(Globalize.translate('HeaderIfYouLikeCheckTheseOut', item.Name));
var html = LibraryBrowser.getPosterViewHtml({
var html = '';
if (enableScrollX()) {
html += '<div class="hiddenScrollX itemsContainer">';
} else {
html += '<div class="itemsContainer">';
}
html += LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: shape,
showParentTitle: item.Type == "MusicAlbum",
@ -682,6 +705,7 @@
coverImage: item.Type == "MusicAlbum" || item.Type == "MusicArtist",
overlayPlayButton: true
});
html += '</div>';
$('#similarContent', page).html(html).lazyChildren().createCardMenus();
});