mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update lazy loading
This commit is contained in:
parent
b9f3bc6cf1
commit
ae6726b46f
3 changed files with 18 additions and 20 deletions
|
@ -49,11 +49,7 @@
|
|||
that.src = FALLBACK_IMAGE;
|
||||
that.loadingSrc = src;
|
||||
|
||||
if (ImageFetcherLazyloadImage) {
|
||||
ImageFetcherLazyloadImage.loadImage(that, src);
|
||||
} else {
|
||||
that.src = src;
|
||||
}
|
||||
} else {
|
||||
that.loadingSrc = null;
|
||||
}
|
||||
|
@ -64,24 +60,26 @@
|
|||
});
|
||||
}
|
||||
|
||||
//// lifecycle callbacks
|
||||
//LazyloadImagePrototype.createdCallback = function () {
|
||||
// lifecycle callbacks
|
||||
LazyloadImagePrototype.createdCallback = function () {
|
||||
|
||||
// var that = this;
|
||||
var that = this;
|
||||
|
||||
// // swap original src attribute
|
||||
// this.original = this.currentSrc || this.src;
|
||||
// this.src = FALLBACK_IMAGE;
|
||||
if (window.ImageFetcherLazyloadImage) {
|
||||
// swap original src attribute
|
||||
this.original = this.currentSrc || this.src;
|
||||
this.src = FALLBACK_IMAGE;
|
||||
|
||||
// var observer = new MutationObserver(function (mutations) {
|
||||
// imgObserver(that, mutations);
|
||||
// });
|
||||
var observer = new MutationObserver(function (mutations) {
|
||||
imgObserver(that, mutations);
|
||||
});
|
||||
|
||||
// // pass in the target node, as well as the observer options
|
||||
// observer.observe(this, { attributes: true, childList: false, characterData: false });
|
||||
// pass in the target node, as well as the observer options
|
||||
observer.observe(this, { attributes: true, childList: false, characterData: false });
|
||||
|
||||
// this.observer = observer;
|
||||
//};
|
||||
this.observer = observer;
|
||||
}
|
||||
};
|
||||
|
||||
//LazyloadImagePrototype.attachedCallback = function () {
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
var html = '';
|
||||
|
||||
var maxPhysical = 60;
|
||||
var maxPhysical = 80;
|
||||
|
||||
html += '<template is="dom-bind">\
|
||||
<iron-list as="item" id="ironList" scroll-target="' + scrollTarget + '" max-physical-count="' + maxPhysical + '" style="width:96%;" grid>\
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
StartIndex: 0,
|
||||
Limit: pageSize
|
||||
},
|
||||
view: libraryBrowser.getSavedView(key) || libraryBrowser.getDefaultItemsView('Poster', 'Thumb')
|
||||
view: libraryBrowser.getSavedView(key) || libraryBrowser.getDefaultItemsView('Poster', 'Poster')
|
||||
};
|
||||
|
||||
pageData.query.ParentId = params.topParentId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue