mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix layout issues on mobile item details
This commit is contained in:
parent
898704d9b0
commit
e9d956f5f1
3 changed files with 48 additions and 7 deletions
|
@ -250,6 +250,22 @@
|
||||||
padding-bottom: 10vh;
|
padding-bottom: 10vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.primaryImageWrapper {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primaryImageWrapper > img {
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
max-width: 80vw;
|
||||||
|
max-height: 50vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layout-mobile .primaryImageWrapper {
|
||||||
|
display: block;
|
||||||
|
flex: 1 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
@media all and (min-width: 40em) {
|
@media all and (min-width: 40em) {
|
||||||
.dashboardDocument .adminDrawerLogo,
|
.dashboardDocument .adminDrawerLogo,
|
||||||
.dashboardDocument .mainDrawerButton {
|
.dashboardDocument .mainDrawerButton {
|
||||||
|
@ -453,8 +469,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.layout-mobile .itemBackdrop {
|
.layout-mobile .itemBackdrop {
|
||||||
background-attachment: scroll;
|
display: none;
|
||||||
height: 26.5vh;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.layout-desktop .itemBackdrop::after {
|
.layout-desktop .itemBackdrop::after {
|
||||||
|
@ -614,6 +629,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.layout-mobile .mainDetailButtons {
|
.layout-mobile .mainDetailButtons {
|
||||||
|
flex: 2 0 70%;
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
@ -638,9 +654,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.layout-mobile .detailPagePrimaryContainer {
|
.layout-mobile .detailPagePrimaryContainer {
|
||||||
display: block;
|
flex-wrap: wrap;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0.5em 3.3% 0.5em;
|
padding: 4.5rem 3.3% 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layout-tv #itemDetailPage:not(.noBackdrop) .detailPagePrimaryContainer,
|
.layout-tv #itemDetailPage:not(.noBackdrop) .detailPagePrimaryContainer,
|
||||||
|
@ -669,6 +685,10 @@
|
||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.layout-mobile .infoWrapper {
|
||||||
|
flex: 2 0 70%;
|
||||||
|
}
|
||||||
|
|
||||||
.infoText {
|
.infoText {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
@ -729,7 +749,8 @@
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noBackdrop .detailLogo {
|
.noBackdrop .detailLogo,
|
||||||
|
.layout-mobile .detailLogo {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
<div class="detailLogo"></div>
|
<div class="detailLogo"></div>
|
||||||
<div class="detailPageWrapperContainer">
|
<div class="detailPageWrapperContainer">
|
||||||
<div class="detailPagePrimaryContainer padded-left padded-right">
|
<div class="detailPagePrimaryContainer padded-left padded-right">
|
||||||
|
<div class="primaryImageWrapper">
|
||||||
|
<img id="primaryImage" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="infoWrapper infoText">
|
<div class="infoWrapper infoText">
|
||||||
<div class="nameContainer"></div>
|
<div class="nameContainer"></div>
|
||||||
<div class="itemMiscInfo itemMiscInfo-primary" style="margin-bottom: 0.6em;"></div>
|
<div class="itemMiscInfo itemMiscInfo-primary" style="margin-bottom: 0.6em;"></div>
|
||||||
|
|
|
@ -552,7 +552,7 @@ function renderDetailPageBackdrop(page, item, apiClient) {
|
||||||
let hasbackdrop = false;
|
let hasbackdrop = false;
|
||||||
const itemBackdropElement = page.querySelector('#itemBackdrop');
|
const itemBackdropElement = page.querySelector('#itemBackdrop');
|
||||||
|
|
||||||
if (!layoutManager.mobile && !userSettings.detailsBanner()) {
|
if (layoutManager.mobile || !userSettings.detailsBanner()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -589,6 +589,19 @@ function renderDetailPageBackdrop(page, item, apiClient) {
|
||||||
return hasbackdrop;
|
return hasbackdrop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renderPrimaryImage(page, item, apiClient) {
|
||||||
|
if (item?.ImageTags?.Primary) {
|
||||||
|
const imageUrl = apiClient.getScaledImageUrl(item.Id, {
|
||||||
|
type: 'Primary',
|
||||||
|
maxWidth: dom.getScreenWidth(),
|
||||||
|
tag: item.ImageTags.Primary
|
||||||
|
});
|
||||||
|
|
||||||
|
page.querySelector('#primaryImage').src = imageUrl;
|
||||||
|
page.querySelector('.primaryImageWrapper')?.classList.remove('hide');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function reloadFromItem(instance, page, params, item, user) {
|
function reloadFromItem(instance, page, params, item, user) {
|
||||||
const apiClient = ServerConnections.getApiClient(item.ServerId);
|
const apiClient = ServerConnections.getApiClient(item.ServerId);
|
||||||
|
|
||||||
|
@ -601,6 +614,9 @@ function reloadFromItem(instance, page, params, item, user) {
|
||||||
renderLogo(page, item, apiClient);
|
renderLogo(page, item, apiClient);
|
||||||
renderDetailPageBackdrop(page, item, apiClient);
|
renderDetailPageBackdrop(page, item, apiClient);
|
||||||
}
|
}
|
||||||
|
if (layoutManager.mobile) {
|
||||||
|
renderPrimaryImage(page, item, apiClient);
|
||||||
|
}
|
||||||
renderBackdrop(item);
|
renderBackdrop(item);
|
||||||
|
|
||||||
// Render the main information for the item
|
// Render the main information for the item
|
||||||
|
@ -2073,7 +2089,7 @@ export default function (view, params) {
|
||||||
view.addEventListener('viewshow', function (e) {
|
view.addEventListener('viewshow', function (e) {
|
||||||
const page = this;
|
const page = this;
|
||||||
|
|
||||||
libraryMenu.setTransparentMenu(true);
|
libraryMenu.setTransparentMenu(!layoutManager.mobile);
|
||||||
|
|
||||||
if (e.detail.isRestored) {
|
if (e.detail.isRestored) {
|
||||||
if (currentItem) {
|
if (currentItem) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue