1
0
Fork 0
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:
Luke Pulverenti 2016-07-30 01:42:58 -04:00
parent b160cd48a3
commit e0faf75197
3 changed files with 77 additions and 12 deletions

View file

@ -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();
}
});