mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixed page title on collection screens
This commit is contained in:
parent
e6da08f559
commit
cba380b0e5
4 changed files with 20 additions and 81 deletions
|
@ -101,11 +101,11 @@
|
|||
}
|
||||
|
||||
.portraitPosterItem {
|
||||
width: 110px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.portraitPosterItem .posterItemImage {
|
||||
height: 165px;
|
||||
height: 150px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
$('#recentlyAddedItems', page).html(LibraryBrowser.getGamePosterViewHtml({
|
||||
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
useAverageAspectRatio: true,
|
||||
showNewIndicator: false
|
||||
|
@ -25,7 +25,7 @@
|
|||
|
||||
});
|
||||
|
||||
var options = {
|
||||
options = {
|
||||
|
||||
SortBy: "DatePlayed",
|
||||
SortOrder: "Descending",
|
||||
|
@ -38,10 +38,9 @@
|
|||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
$('#resumableItems', page).html(LibraryBrowser.getGamePosterViewHtml({
|
||||
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
useAverageAspectRatio: true,
|
||||
showNewIndicator: false
|
||||
useAverageAspectRatio: true
|
||||
}));
|
||||
|
||||
});
|
||||
|
|
|
@ -62,8 +62,17 @@
|
|||
|
||||
ApiClient.getItem(userId, query.ParentId).done(function (item) {
|
||||
|
||||
$('#itemName', page).html(item.Name);
|
||||
var name = item.Name;
|
||||
|
||||
if (item.IndexNumber != null) {
|
||||
name = item.IndexNumber + " - " + name;
|
||||
}
|
||||
if (item.ParentIndexNumber != null) {
|
||||
name = item.ParentIndexNumber + "." + name;
|
||||
}
|
||||
|
||||
$('#itemName', page).html(name);
|
||||
Dashboard.setPageTitle(name);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1250,75 +1250,6 @@
|
|||
}
|
||||
},
|
||||
|
||||
getGamePosterViewHtml: function (options) {
|
||||
|
||||
var items = options.items;
|
||||
|
||||
var primaryImageAspectRatio = options.useAverageAspectRatio ? LibraryBrowser.getAveragePrimaryImageAspectRatio(items) : null;
|
||||
|
||||
var html = "";
|
||||
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
var item = items[i];
|
||||
|
||||
var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary;
|
||||
|
||||
var showText = options.showTitle || !hasPrimaryImage;
|
||||
|
||||
var cssClass = showText ? "posterViewItem" : "posterViewItem posterViewItemWithNoText";
|
||||
|
||||
html += "<div class='" + cssClass + "'><a href='" + LibraryBrowser.getHref(item, "games") + "'>";
|
||||
|
||||
if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||
html += "<img src='" + ApiClient.getImageUrl(item.Id, {
|
||||
type: "Backdrop",
|
||||
height: 198,
|
||||
width: 352,
|
||||
tag: item.BackdropImageTags[0]
|
||||
|
||||
}) + "' />";
|
||||
} else if (hasPrimaryImage) {
|
||||
|
||||
var height = 300;
|
||||
var width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null;
|
||||
|
||||
html += "<img src='" + ApiClient.getImageUrl(item.Id, {
|
||||
type: "Primary",
|
||||
height: height,
|
||||
width: width,
|
||||
tag: item.ImageTags.Primary
|
||||
|
||||
}) + "' />";
|
||||
|
||||
} else if (item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||
html += "<img src='" + ApiClient.getImageUrl(item.Id, {
|
||||
type: "Backdrop",
|
||||
height: 198,
|
||||
width: 352,
|
||||
tag: item.BackdropImageTags[0]
|
||||
|
||||
}) + "' />";
|
||||
}
|
||||
else {
|
||||
html += "<img style='background:" + defaultBackground + ";' src='css/images/items/list/game.png' />";
|
||||
}
|
||||
|
||||
if (showText) {
|
||||
html += "<div class='posterViewItemText'>";
|
||||
html += item.Name;
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
if (options.showNewIndicator !== false) {
|
||||
html += LibraryBrowser.getNewIndicatorHtml(item);
|
||||
}
|
||||
|
||||
html += "</a></div>";
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
shouldDisplayGallery: function (item) {
|
||||
|
||||
var imageTags = item.ImageTags || {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue