mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix tv screens
This commit is contained in:
parent
b160cd48a3
commit
e0faf75197
3 changed files with 77 additions and 12 deletions
|
@ -104,6 +104,24 @@
|
|||
}
|
||||
}
|
||||
|
||||
function onViewStyleChange(parentItem) {
|
||||
|
||||
var query = getQuery(parentItem);
|
||||
|
||||
var itemsContainer = view.querySelector('#items');
|
||||
|
||||
if (query.IncludeItemTypes == "Audio") {
|
||||
|
||||
itemsContainer.classList.add('vertical-list');
|
||||
itemsContainer.classList.remove('vertical-wrap');
|
||||
|
||||
} else {
|
||||
|
||||
itemsContainer.classList.remove('vertical-list');
|
||||
itemsContainer.classList.add('vertical-wrap');
|
||||
}
|
||||
}
|
||||
|
||||
function reloadItems(parentItem) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
@ -125,16 +143,19 @@
|
|||
|
||||
view.querySelector('.listTopPaging').innerHTML = pagingHtml;
|
||||
|
||||
var itemsContainer = view.querySelector('#items');
|
||||
|
||||
if (query.IncludeItemTypes == "Audio") {
|
||||
|
||||
html = '<div style="max-width:1000px;margin:auto;">' + listView.getListViewHtml({
|
||||
html = listView.getListViewHtml({
|
||||
items: result.Items,
|
||||
playFromHere: true,
|
||||
action: 'playallfromhere',
|
||||
smallIcon: true
|
||||
}) + '</div>';
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
var posterOptions = {
|
||||
items: result.Items,
|
||||
shape: "auto",
|
||||
|
@ -163,9 +184,8 @@
|
|||
html = cardBuilder.getCardsHtml(posterOptions);
|
||||
}
|
||||
|
||||
var elem = view.querySelector('#items');
|
||||
elem.innerHTML = html + pagingHtml;
|
||||
ImageLoader.lazyChildren(elem);
|
||||
itemsContainer.innerHTML = html + pagingHtml;
|
||||
ImageLoader.lazyChildren(itemsContainer);
|
||||
|
||||
var i, length;
|
||||
var elems;
|
||||
|
@ -201,11 +221,13 @@
|
|||
ApiClient.getItem(Dashboard.getCurrentUserId(), params.parentId).then(function (parent) {
|
||||
LibraryMenu.setTitle(parent.Name);
|
||||
|
||||
onViewStyleChange(parent);
|
||||
reloadItems(parent);
|
||||
});
|
||||
}
|
||||
|
||||
else {
|
||||
onViewStyleChange();
|
||||
reloadItems();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue