fix itemlist

This commit is contained in:
Luke Pulverenti 2016-07-30 02:41:51 -04:00
parent 7f2ed3fa52
commit b971acb33a
3 changed files with 35 additions and 13 deletions

View File

@ -10,6 +10,6 @@
<button is="paper-icon-button-light" class="btnFilter autoSize" title="${ButtonFilter}"><i class="md-icon">filter_list</i></button>
<button type="button" is="paper-icon-button-light" class="btnNewCollection autoSize hide"><i class="md-icon">add</i></button>
</div>
<div is="emby-itemscontainer" id="items" class="itemsContainer paddedItemsContainer itemsContainerWithAlphaPicker" style="text-align:center;"></div>
<div is="emby-itemscontainer" id="items" class="itemsContainer paddedItemsContainer itemsContainerWithAlphaPicker"></div>
</div>
</div>

View File

@ -109,7 +109,7 @@
ArtistIds: "",
Limit: 10
}, {
shape: "detailPagePortrait",
shape: "portrait",
showTitle: true,
centerText: true,
overlayMoreButton: true
@ -124,7 +124,7 @@
ArtistIds: "",
Limit: 10
}, {
shape: "detailPagePortrait",
shape: "portrait",
showTitle: true,
centerText: true,
overlayPlayButton: true
@ -139,7 +139,7 @@
ArtistIds: "",
Limit: 10
}, {
shape: "detailPagePortrait",
shape: "portrait",
showTitle: true,
centerText: true,
overlayMoreButton: true
@ -154,7 +154,7 @@
ArtistIds: "",
Limit: 10
}, {
shape: "detailPagePortrait",
shape: "portrait",
showTitle: true,
centerText: true,
overlayPlayButton: true
@ -169,7 +169,7 @@
ArtistIds: "",
Limit: 10
}, {
shape: "detailPagePortrait",
shape: "portrait",
showTitle: true,
centerText: true,
overlayMoreButton: true
@ -184,7 +184,7 @@
ArtistIds: "",
Limit: 8
}, {
shape: "detailPageSquare",
shape: "square",
playFromHere: true,
showTitle: true,
showParentTitle: true,
@ -201,7 +201,7 @@
ArtistIds: "",
Limit: 6
}, {
shape: "detailPage169",
shape: "backdrop",
showTitle: true,
showParentTitle: true,
centerText: true,

View File

@ -1,4 +1,4 @@
define(['libraryBrowser', 'alphaPicker', 'listView', 'emby-itemscontainer'], function (libraryBrowser, alphaPicker, listView) {
define(['libraryBrowser', 'alphaPicker', 'listView', 'cardBuilder', 'emby-itemscontainer'], function (libraryBrowser, alphaPicker, listView, cardBuilder) {
return function (view, params) {
@ -45,6 +45,25 @@
return view.savedQueryKey;
}
function onViewStyleChange() {
var viewStyle = getPageData(view).view;
var itemsContainer = view.querySelector('#items');
if (viewStyle == "List") {
itemsContainer.classList.add('vertical-list');
itemsContainer.classList.remove('vertical-wrap');
}
else {
itemsContainer.classList.remove('vertical-list');
itemsContainer.classList.add('vertical-wrap');
}
itemsContainer.innerHTML = '';
}
function reloadItems() {
Dashboard.showLoadingMsg();
@ -101,7 +120,7 @@
posterOptions.showTitle = true;
posterOptions.preferBackdrop = true;
html = libraryBrowser.getPosterViewHtml(posterOptions);
html = cardBuilder.getCardsHtml(posterOptions);
}
else if (viewStyle == "PosterCard") {
@ -110,7 +129,7 @@
posterOptions.cardLayout = true;
posterOptions.centerText = false;
html = libraryBrowser.getPosterViewHtml(posterOptions);
html = cardBuilder.getCardsHtml(posterOptions);
}
else if (viewStyle == "List") {
@ -123,14 +142,14 @@
posterOptions.preferThumb = true;
posterOptions.shape = "backdrop";
html = libraryBrowser.getPosterViewHtml(posterOptions);
html = cardBuilder.getCardsHtml(posterOptions);
} else {
// Poster
posterOptions.showTitle = context == 'photos' ? 'auto' : true;
posterOptions.overlayText = context == 'photos';
html = libraryBrowser.getPosterViewHtml(posterOptions);
html = cardBuilder.getCardsHtml(posterOptions);
}
if (currentItem.CollectionType == 'boxsets') {
@ -273,9 +292,12 @@
var layout = e.detail.viewStyle;
getPageData().view = layout;
libraryBrowser.saveViewSetting(getSavedQueryKey(), layout);
onViewStyleChange();
reloadItems(view);
});
onViewStyleChange();
view.querySelector('.btnFilter').addEventListener('click', function () {
showFilterMenu();
});