Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change cast & crew view to horizontal scroller #294

Merged
merged 2 commits into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/controllers/itemdetailpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1028,19 +1028,15 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
if (!people.length) return void page.querySelector("#castCollapsible").classList.add("hide");
page.querySelector("#castCollapsible").classList.remove("hide");
var castContent = page.querySelector("#castContent");
enableScrollX() ? (castContent.classList.add("scrollX"), limit = 32) : castContent.classList.add("vertical-wrap");
var limitExceeded = limit && people.length > limit;
limitExceeded && (people = people.slice(0), people.length = Math.min(limit, people.length)), require(["peoplecardbuilder"], function(peoplecardbuilder) {
require(["peoplecardbuilder"], function(peoplecardbuilder) {
peoplecardbuilder.buildPeopleCards(people, {
itemsContainer: castContent,
coverImage: !0,
serverId: item.ServerId,
width: 160,
shape: getPortraitShape()
})
});
var morePeopleButton = page.querySelector(".morePeople");
morePeopleButton && (limitExceeded && !enableScrollX() ? morePeopleButton.classList.remove("hide") : morePeopleButton.classList.add("hide"))
})
}

function itemDetailPage() {
Expand Down
11 changes: 6 additions & 5 deletions src/itemdetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,13 @@ <h2 class="sectionTitle sectionTitle-cards padded-left padded-right"></h2>
</div>

<div id="castCollapsible" class="verticalSection detailVerticalSection hide">
<h2 id="peopleHeader" class="sectionTitle sectionTitle-cards padded-left">
<h2 id="peopleHeader" class="sectionTitle sectionTitle-cards padded-left padded-right">
${HeaderCastCrew}
</h2>
<div id="castContent" is="emby-itemscontainer" class="itemsContainer padded-left padded-right"></div>
<div class="padded-left">
<button is="emby-button" type="button" class="raised more morePeople hide">${ButtonMore}</button>
<div is="emby-scroller" class="emby-scroller" data-mousewheel="false" data-centerfocus="true" data-horizontal="true">
<div class="scrollerframe padded-top-focusscale padded-bottom-focusscale">
<div id="castContent" is="emby-itemscontainer" class="scrollSlider focuscontainer-x itemsContainer padded-left padded-right"></div>
</div>
</div>
</div>
<div id="seriesScheduleSection" class="verticalSection detailVerticalSection hide">
Expand Down Expand Up @@ -312,4 +313,4 @@ <h2 class="sectionTitle padded-left" style="margin-bottom:0;">${HeaderMediaInfo}
</div>
</div>
</div>
</div>
</div>