1
0
Fork 0
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:
Luke Pulverenti 2016-04-24 01:27:12 -04:00
parent b9f3bc6cf1
commit ae6726b46f
3 changed files with 18 additions and 20 deletions

View file

@ -49,11 +49,7 @@
that.src = FALLBACK_IMAGE;
that.loadingSrc = src;
if (ImageFetcherLazyloadImage) {
ImageFetcherLazyloadImage.loadImage(that, src);
} else {
that.src = src;
}
ImageFetcherLazyloadImage.loadImage(that, 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 () {