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

Add placeholder image if non-editable

This commit is contained in:
MrTimscampi 2020-01-29 19:05:23 +01:00
parent d989d7b007
commit c1b9a094af
2 changed files with 16 additions and 8 deletions

View file

@ -542,6 +542,10 @@
-webkit-box-shadow: 0 0.0725em 0.29em 0 rgba(0, 0, 0, 0.37); -webkit-box-shadow: 0 0.0725em 0.29em 0 rgba(0, 0, 0, 0.37);
} }
div.itemDetailGalleryLink.defaultCardBackground {
text-align: center;
}
.itemDetailGalleryLink.defaultCardBackground { .itemDetailGalleryLink.defaultCardBackground {
height: 23vw; /* Dirty hack to get it to look somewhat square. Less than ideal. */ height: 23vw; /* Dirty hack to get it to look somewhat square. Less than ideal. */
} }

View file

@ -797,18 +797,12 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
if (editable && url === undefined) { if (editable && url === undefined) {
html += "<a class='itemDetailGalleryLink itemDetailImage defaultCardBackground defaultCardBackground"+ cardBuilder.getDefaultBackgroundClass(item.Name) + "' is='emby-linkbutton' style='display:block;margin:0;padding:0;' href='#'>"; html += "<a class='itemDetailGalleryLink itemDetailImage defaultCardBackground defaultCardBackground"+ cardBuilder.getDefaultBackgroundClass(item.Name) + "' is='emby-linkbutton' style='display:block;margin:0;padding:0;' href='#'>";
} else if (!editable && url === undefined) {
html += "<div class='itemDetailGalleryLink itemDetailImage defaultCardBackground defaultCardBackground"+ cardBuilder.getDefaultBackgroundClass(item.Name) + "' is='emby-linkbutton' style='display:block;margin:0;padding:0;' href='#'>";
} else if (editable) { } else if (editable) {
html += "<a class='itemDetailGalleryLink' is='emby-linkbutton' style='display:block;margin:0;padding:0;' href='#'>"; html += "<a class='itemDetailGalleryLink' is='emby-linkbutton' style='display:block;margin:0;padding:0;' href='#'>";
} }
if (detectRatio && item.PrimaryImageAspectRatio) {
if (item.PrimaryImageAspectRatio >= 1.48) {
shape = "thumb";
} else if (item.PrimaryImageAspectRatio >= 0.85 && item.PrimaryImageAspectRatio <= 1.34) {
shape = "square";
}
}
if (url) { if (url) {
html += "<img class='itemDetailImage lazy' src='data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=' />"; html += "<img class='itemDetailImage lazy' src='data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=' />";
} }
@ -819,6 +813,8 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
if (editable) { if (editable) {
html += "</a>"; html += "</a>";
} else if (!editable && url === undefined) {
html += "</div>"
} }
var progressHtml = item.IsFolder || !item.UserData ? "" : indicators.getProgressBarHtml(item); var progressHtml = item.IsFolder || !item.UserData ? "" : indicators.getProgressBarHtml(item);
@ -831,6 +827,14 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
html += "</div>"; html += "</div>";
elem.innerHTML = html; elem.innerHTML = html;
if (detectRatio && item.PrimaryImageAspectRatio) {
if (item.PrimaryImageAspectRatio >= 1.48) {
shape = "thumb";
} else if (item.PrimaryImageAspectRatio >= 0.85 && item.PrimaryImageAspectRatio <= 1.34) {
shape = "square";
}
}
if ("thumb" == shape) { if ("thumb" == shape) {
elem.classList.add("thumbDetailImageContainer"); elem.classList.add("thumbDetailImageContainer");
elem.classList.remove("portraitDetailImageContainer"); elem.classList.remove("portraitDetailImageContainer");