mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix itemlist
This commit is contained in:
parent
7f2ed3fa52
commit
b971acb33a
3 changed files with 35 additions and 13 deletions
|
@ -10,6 +10,6 @@
|
||||||
<button is="paper-icon-button-light" class="btnFilter autoSize" title="${ButtonFilter}"><i class="md-icon">filter_list</i></button>
|
<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>
|
<button type="button" is="paper-icon-button-light" class="btnNewCollection autoSize hide"><i class="md-icon">add</i></button>
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
|
@ -109,7 +109,7 @@
|
||||||
ArtistIds: "",
|
ArtistIds: "",
|
||||||
Limit: 10
|
Limit: 10
|
||||||
}, {
|
}, {
|
||||||
shape: "detailPagePortrait",
|
shape: "portrait",
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
centerText: true,
|
centerText: true,
|
||||||
overlayMoreButton: true
|
overlayMoreButton: true
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
ArtistIds: "",
|
ArtistIds: "",
|
||||||
Limit: 10
|
Limit: 10
|
||||||
}, {
|
}, {
|
||||||
shape: "detailPagePortrait",
|
shape: "portrait",
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
centerText: true,
|
centerText: true,
|
||||||
overlayPlayButton: true
|
overlayPlayButton: true
|
||||||
|
@ -139,7 +139,7 @@
|
||||||
ArtistIds: "",
|
ArtistIds: "",
|
||||||
Limit: 10
|
Limit: 10
|
||||||
}, {
|
}, {
|
||||||
shape: "detailPagePortrait",
|
shape: "portrait",
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
centerText: true,
|
centerText: true,
|
||||||
overlayMoreButton: true
|
overlayMoreButton: true
|
||||||
|
@ -154,7 +154,7 @@
|
||||||
ArtistIds: "",
|
ArtistIds: "",
|
||||||
Limit: 10
|
Limit: 10
|
||||||
}, {
|
}, {
|
||||||
shape: "detailPagePortrait",
|
shape: "portrait",
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
centerText: true,
|
centerText: true,
|
||||||
overlayPlayButton: true
|
overlayPlayButton: true
|
||||||
|
@ -169,7 +169,7 @@
|
||||||
ArtistIds: "",
|
ArtistIds: "",
|
||||||
Limit: 10
|
Limit: 10
|
||||||
}, {
|
}, {
|
||||||
shape: "detailPagePortrait",
|
shape: "portrait",
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
centerText: true,
|
centerText: true,
|
||||||
overlayMoreButton: true
|
overlayMoreButton: true
|
||||||
|
@ -184,7 +184,7 @@
|
||||||
ArtistIds: "",
|
ArtistIds: "",
|
||||||
Limit: 8
|
Limit: 8
|
||||||
}, {
|
}, {
|
||||||
shape: "detailPageSquare",
|
shape: "square",
|
||||||
playFromHere: true,
|
playFromHere: true,
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
showParentTitle: true,
|
showParentTitle: true,
|
||||||
|
@ -201,7 +201,7 @@
|
||||||
ArtistIds: "",
|
ArtistIds: "",
|
||||||
Limit: 6
|
Limit: 6
|
||||||
}, {
|
}, {
|
||||||
shape: "detailPage169",
|
shape: "backdrop",
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
showParentTitle: true,
|
showParentTitle: true,
|
||||||
centerText: true,
|
centerText: true,
|
||||||
|
|
|
@ -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) {
|
return function (view, params) {
|
||||||
|
|
||||||
|
@ -45,6 +45,25 @@
|
||||||
return view.savedQueryKey;
|
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() {
|
function reloadItems() {
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
@ -101,7 +120,7 @@
|
||||||
posterOptions.showTitle = true;
|
posterOptions.showTitle = true;
|
||||||
posterOptions.preferBackdrop = true;
|
posterOptions.preferBackdrop = true;
|
||||||
|
|
||||||
html = libraryBrowser.getPosterViewHtml(posterOptions);
|
html = cardBuilder.getCardsHtml(posterOptions);
|
||||||
}
|
}
|
||||||
else if (viewStyle == "PosterCard") {
|
else if (viewStyle == "PosterCard") {
|
||||||
|
|
||||||
|
@ -110,7 +129,7 @@
|
||||||
posterOptions.cardLayout = true;
|
posterOptions.cardLayout = true;
|
||||||
posterOptions.centerText = false;
|
posterOptions.centerText = false;
|
||||||
|
|
||||||
html = libraryBrowser.getPosterViewHtml(posterOptions);
|
html = cardBuilder.getCardsHtml(posterOptions);
|
||||||
}
|
}
|
||||||
else if (viewStyle == "List") {
|
else if (viewStyle == "List") {
|
||||||
|
|
||||||
|
@ -123,14 +142,14 @@
|
||||||
|
|
||||||
posterOptions.preferThumb = true;
|
posterOptions.preferThumb = true;
|
||||||
posterOptions.shape = "backdrop";
|
posterOptions.shape = "backdrop";
|
||||||
html = libraryBrowser.getPosterViewHtml(posterOptions);
|
html = cardBuilder.getCardsHtml(posterOptions);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Poster
|
// Poster
|
||||||
posterOptions.showTitle = context == 'photos' ? 'auto' : true;
|
posterOptions.showTitle = context == 'photos' ? 'auto' : true;
|
||||||
posterOptions.overlayText = context == 'photos';
|
posterOptions.overlayText = context == 'photos';
|
||||||
|
|
||||||
html = libraryBrowser.getPosterViewHtml(posterOptions);
|
html = cardBuilder.getCardsHtml(posterOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentItem.CollectionType == 'boxsets') {
|
if (currentItem.CollectionType == 'boxsets') {
|
||||||
|
@ -273,9 +292,12 @@
|
||||||
var layout = e.detail.viewStyle;
|
var layout = e.detail.viewStyle;
|
||||||
getPageData().view = layout;
|
getPageData().view = layout;
|
||||||
libraryBrowser.saveViewSetting(getSavedQueryKey(), layout);
|
libraryBrowser.saveViewSetting(getSavedQueryKey(), layout);
|
||||||
|
onViewStyleChange();
|
||||||
reloadItems(view);
|
reloadItems(view);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onViewStyleChange();
|
||||||
|
|
||||||
view.querySelector('.btnFilter').addEventListener('click', function () {
|
view.querySelector('.btnFilter').addEventListener('click', function () {
|
||||||
showFilterMenu();
|
showFilterMenu();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue