MCPcopy Create free account
hub / github.com/MALSync/MALSync / processScroll

Function processScroll

src/utils/general.ts:796–808  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

794 lazyimages = [];
795 const query = doc.find('img.lazy.init, .lazyBack.init');
796 const processScroll = function () {
797 for (let i = 0; i < lazyimages.length; i++) {
798 if (utils.elementInViewport(lazyimages[i], 600)) {
799 // eslint-disable-next-line
800 loadImage(lazyimages[i], function() {
801 lazyimages.splice(i, i);
802 });
803 }
804 if (!$(lazyimages[i]).length) {
805 lazyimages.splice(i, i);
806 }
807 }
808 };
809 // Array.prototype.slice.call is not callable under our lovely IE8
810 for (let i = 0; i < query.length; i++) {
811 lazyimages.push(query[i]);

Callers 1

lazyloadFunction · 0.85

Calls 1

loadImageFunction · 0.85

Tested by

no test coverage detected