From a06a0e951537536cb3251ec966c43ae83467d098 Mon Sep 17 00:00:00 2001 From: ferferga Date: Sun, 5 Apr 2020 00:59:37 +0200 Subject: [PATCH] Fix layout also for desktop --- src/assets/css/librarybrowser.css | 11 ++++++----- src/controllers/itemdetailpage.js | 20 ++++++++++++++++---- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/assets/css/librarybrowser.css b/src/assets/css/librarybrowser.css index 1a3d75a9f2..1f9b25ac2b 100644 --- a/src/assets/css/librarybrowser.css +++ b/src/assets/css/librarybrowser.css @@ -518,6 +518,12 @@ margin: 0.5em 0; } +.nameContainer { + display: flex; + flex-direction: column; + flex-wrap: wrap; +} + .itemMiscInfo { display: -webkit-box; display: -webkit-flex; @@ -529,10 +535,6 @@ align-items: center; } -.parentName > a:nth-child(3) { - font-size: 0.7em; -} - .layout-mobile .parentName, .layout-mobile .itemName, .layout-mobile .itemMiscInfo, @@ -578,7 +580,6 @@ .infoText { white-space: nowrap; - overflow: hidden; text-overflow: ellipsis; text-align: left; } diff --git a/src/controllers/itemdetailpage.js b/src/controllers/itemdetailpage.js index 99bb038c70..f2feb62ba8 100644 --- a/src/controllers/itemdetailpage.js +++ b/src/controllers/itemdetailpage.js @@ -336,7 +336,6 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "userSetti return html = html.join(" / "); } - // TODO: Clean this and the CSS rules for mobile layout. See #1022 function renderName(item, container, isStatic, context) { var parentRoute; var parentNameHtml = []; @@ -406,9 +405,18 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "userSetti if (parentNameHtml.length) { if (parentNameLast) { - html = '

' + parentNameHtml.join("
") + "

"; + // Music + if (layoutManager.mobile) { + html = '

' + parentNameHtml.join("
") + "

"; + } else { + html = '

' + parentNameHtml.join(" - ") + "

"; + } } else { - html = '

' + parentNameHtml.join("
") + "

"; + if (layoutManager.mobile) { + html = '

' + parentNameHtml.join("
") + "

"; + } else { + html = '

' + parentNameHtml[0] + "

"; + } } } @@ -418,7 +426,11 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "userSetti var offset = parentNameLast ? ".25em" : ".5em"; if (html && !parentNameLast) { - html += '

' + name + '

'; + if (!layoutManager.mobile && parentNameHtml[1]) { + html += '

' + parentNameHtml[1] + ' - ' + name + '

'; + } else { + html += '

' + name + '

'; + } } else { html = '

' + name + "

" + html; }