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.src = FALLBACK_IMAGE;
|
||||||
that.loadingSrc = src;
|
that.loadingSrc = src;
|
||||||
|
|
||||||
if (ImageFetcherLazyloadImage) {
|
|
||||||
ImageFetcherLazyloadImage.loadImage(that, src);
|
ImageFetcherLazyloadImage.loadImage(that, src);
|
||||||
} else {
|
|
||||||
that.src = src;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
that.loadingSrc = null;
|
that.loadingSrc = null;
|
||||||
}
|
}
|
||||||
|
@ -64,24 +60,26 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//// lifecycle callbacks
|
// lifecycle callbacks
|
||||||
//LazyloadImagePrototype.createdCallback = function () {
|
LazyloadImagePrototype.createdCallback = function () {
|
||||||
|
|
||||||
// var that = this;
|
var that = this;
|
||||||
|
|
||||||
// // swap original src attribute
|
if (window.ImageFetcherLazyloadImage) {
|
||||||
// this.original = this.currentSrc || this.src;
|
// swap original src attribute
|
||||||
// this.src = FALLBACK_IMAGE;
|
this.original = this.currentSrc || this.src;
|
||||||
|
this.src = FALLBACK_IMAGE;
|
||||||
|
|
||||||
// var observer = new MutationObserver(function (mutations) {
|
var observer = new MutationObserver(function (mutations) {
|
||||||
// imgObserver(that, mutations);
|
imgObserver(that, mutations);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// // pass in the target node, as well as the observer options
|
// pass in the target node, as well as the observer options
|
||||||
// observer.observe(this, { attributes: true, childList: false, characterData: false });
|
observer.observe(this, { attributes: true, childList: false, characterData: false });
|
||||||
|
|
||||||
// this.observer = observer;
|
this.observer = observer;
|
||||||
//};
|
}
|
||||||
|
};
|
||||||
|
|
||||||
//LazyloadImagePrototype.attachedCallback = function () {
|
//LazyloadImagePrototype.attachedCallback = function () {
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
var maxPhysical = 60;
|
var maxPhysical = 80;
|
||||||
|
|
||||||
html += '<template is="dom-bind">\
|
html += '<template is="dom-bind">\
|
||||||
<iron-list as="item" id="ironList" scroll-target="' + scrollTarget + '" max-physical-count="' + maxPhysical + '" style="width:96%;" grid>\
|
<iron-list as="item" id="ironList" scroll-target="' + scrollTarget + '" max-physical-count="' + maxPhysical + '" style="width:96%;" grid>\
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
StartIndex: 0,
|
StartIndex: 0,
|
||||||
Limit: pageSize
|
Limit: pageSize
|
||||||
},
|
},
|
||||||
view: libraryBrowser.getSavedView(key) || libraryBrowser.getDefaultItemsView('Poster', 'Thumb')
|
view: libraryBrowser.getSavedView(key) || libraryBrowser.getDefaultItemsView('Poster', 'Poster')
|
||||||
};
|
};
|
||||||
|
|
||||||
pageData.query.ParentId = params.topParentId;
|
pageData.query.ParentId = params.topParentId;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue