1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #777 from timhobbs/master

Cast updates and lazy loading
This commit is contained in:
Luke 2014-04-10 11:17:36 -04:00
commit b7c828e294
19 changed files with 607 additions and 127 deletions

View file

@ -432,6 +432,8 @@
options.shape = options.shape || "portrait";
options.lazy = options.lazy || false;
var html = "";
var primaryImageAspectRatio = options.shape == 'auto' ? LibraryBrowser.getAveragePrimaryImageAspectRatio(items) : null;
@ -667,7 +669,7 @@
var style = "";
if (imgUrl) {
if (imgUrl && !options.lazy) {
style += 'background-image:url(\'' + imgUrl + '\');';
}
@ -680,9 +682,16 @@
imageCssClass += " coveredPosterItemImage";
}
var dataSrc = "";
if (options.lazy) {
imageCssClass += " lazy";
dataSrc = ' data-src="' + imgUrl + '"';
}
var progressHtml = options.showProgress === false ? '' : LibraryBrowser.getItemProgressBarHtml(item);
html += '<div class="' + imageCssClass + '" style="' + style + '">';
html += '<div class="' + imageCssClass + '" style="' + style + '"' + dataSrc + '>';
html += '<div class="posterItemOverlayTarget"></div>';
@ -755,6 +764,10 @@
var itemCountHtml = LibraryBrowser.getItemCountsHtml(options, item);
if (item.Type == "Person" && !itemCountHtml) {
itemCountHtml = "&nbsp;";
}
if (itemCountHtml) {
html += "<div class='" + cssClass + "'>";
html += itemCountHtml;