mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
scale image sizes depending on pixel ratio
This commit is contained in:
parent
5677ce1011
commit
4962827f56
6 changed files with 51 additions and 27 deletions
|
@ -73,7 +73,8 @@
|
|||
var imgUrl = ApiClient.getScaledImageUrl(item.id, {
|
||||
type: "Backdrop",
|
||||
tag: item.tag,
|
||||
maxWidth: screenWidth
|
||||
maxWidth: screenWidth,
|
||||
quality: 80
|
||||
});
|
||||
|
||||
getElement().css('backgroundImage', 'url(\'' + imgUrl + '\')');
|
||||
|
@ -102,7 +103,7 @@
|
|||
|
||||
var val = LocalSettings.val('enableBackdrops', userId);
|
||||
|
||||
return val == '1';
|
||||
return val != '0';
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', ".backdropPage", function () {
|
||||
|
|
|
@ -70,11 +70,9 @@
|
|||
html += '<div class="' + imageCssClass + '" style="' + style + '">';
|
||||
html += '</div>';
|
||||
|
||||
if (options.showTitle) {
|
||||
html += "<div class='posterItemDefaultText'>";
|
||||
html += item.Name;
|
||||
html += "</div>";
|
||||
}
|
||||
html += "<div class='posterItemDefaultText posterItemText'>";
|
||||
html += item.Name;
|
||||
html += "</div>";
|
||||
|
||||
html += "</a>";
|
||||
}
|
||||
|
@ -161,6 +159,8 @@
|
|||
html += '</div>';
|
||||
|
||||
$(elem).html(html);
|
||||
|
||||
handleLibraryLinkNavigations(elem);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -228,6 +228,8 @@
|
|||
|
||||
|
||||
$(elem).html(html).createPosterItemMenus();
|
||||
|
||||
handleLibraryLinkNavigations(elem);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -287,8 +289,9 @@
|
|||
}
|
||||
else if (section == 'librarybuttons') {
|
||||
loadlibraryButtons(elem, userId, index);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
elem.empty();
|
||||
}
|
||||
}
|
||||
|
@ -299,7 +302,7 @@
|
|||
var sectionCount = 3;
|
||||
|
||||
var elem = $('.sections', page);
|
||||
|
||||
|
||||
if (!elem.html().length) {
|
||||
var html = '';
|
||||
for (i = 0, length = sectionCount; i < length; i++) {
|
||||
|
@ -316,6 +319,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
function handleLibraryLinkNavigations(elem) {
|
||||
|
||||
$('a', elem).on('click', function () {
|
||||
|
||||
var text = $('.posterItemText', this).html();
|
||||
|
||||
LibraryMenu.setText(text);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#indexPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
|
|
@ -175,6 +175,12 @@
|
|||
|
||||
return panel;
|
||||
}
|
||||
|
||||
function setLibraryMenuText(text) {
|
||||
|
||||
$('.libraryMenuButtonText').html('<span>' + text + '</span>');
|
||||
|
||||
}
|
||||
|
||||
function getTopParentId() {
|
||||
|
||||
|
@ -184,7 +190,9 @@
|
|||
window.LibraryMenu = {
|
||||
showLibraryMenu: showLibraryMenu,
|
||||
|
||||
getTopParentId: getTopParentId
|
||||
getTopParentId: getTopParentId,
|
||||
|
||||
setText: setLibraryMenuText
|
||||
};
|
||||
|
||||
function updateCastIcon() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue