mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
only show gallery when there's something to show
This commit is contained in:
parent
21a8644607
commit
701be2b831
4 changed files with 67 additions and 1 deletions
|
@ -44,6 +44,12 @@
|
||||||
$('#playButtonShadow', page).hide();
|
$('#playButtonShadow', page).hide();
|
||||||
$('#btnQueueMenu', page).hide();
|
$('#btnQueueMenu', page).hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (LibraryBrowser.shouldDisplayGallery(item)) {
|
||||||
|
$('#galleryCollapsible', page).show();
|
||||||
|
} else {
|
||||||
|
$('#galleryCollapsible', page).hide();
|
||||||
|
}
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
});
|
});
|
||||||
|
|
|
@ -31,6 +31,12 @@
|
||||||
setInitialCollapsibleState(page, item);
|
setInitialCollapsibleState(page, item);
|
||||||
renderDetails(page, item);
|
renderDetails(page, item);
|
||||||
|
|
||||||
|
if (LibraryBrowser.shouldDisplayGallery(item)) {
|
||||||
|
$('#galleryCollapsible', page).show();
|
||||||
|
} else {
|
||||||
|
$('#galleryCollapsible', page).hide();
|
||||||
|
}
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -976,6 +976,54 @@
|
||||||
return html;
|
return html;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
shouldDisplayGallery: function (item) {
|
||||||
|
|
||||||
|
var imageTags = item.ImageTags || {};
|
||||||
|
|
||||||
|
if (imageTags.Banner) {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (imageTags.Logo) {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (imageTags.Thumb) {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (imageTags.Art) {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (imageTags.Menu) {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (imageTags.Disc) {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (imageTags.Box) {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.ScreenshotImageTags && item.ScreenshotImageTags.length) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
getGalleryHtml: function (item) {
|
getGalleryHtml: function (item) {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
|
@ -21,7 +21,13 @@
|
||||||
$('#itemName', page).html(name);
|
$('#itemName', page).html(name);
|
||||||
|
|
||||||
setInitialCollapsibleState(page, item);
|
setInitialCollapsibleState(page, item);
|
||||||
renderDetails(page, item);
|
renderDetails(page, item);
|
||||||
|
|
||||||
|
if (LibraryBrowser.shouldDisplayGallery(item)) {
|
||||||
|
$('#galleryCollapsible', page).show();
|
||||||
|
} else {
|
||||||
|
$('#galleryCollapsible', page).hide();
|
||||||
|
}
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue