1document.addEventListener("DOMContentLoaded", function() { 2 let lazySprites = [].slice.call(document.querySelectorAll("img.mainpage_ico")); 3 let active = false; 4 5 const lazyLoadSprite = function() { 6 if (active === false) { 7 active = true; 8 9 setTimeout(function() { 10 lazySprites.forEach(function(lazySprite) { 11 if ((lazySprite.getBoundingClientRect().top <= window.innerHeight && lazySprite.getBoundingClientRect().bottom >= 0) && getComputedStyle(lazySprite).display !== "none") { 12 lazySprite.classList.add(lazySprite.dataset.src); 13 // lazySprite.srcset = lazySprite.dataset.srcset; 14 // lazySprite.classList.remove("lazy"); 15 16 lazySprites = lazySprites.filter(function(image) { 17 return image !== lazySprite; 18 }); 19 20 if (lazySprites.length === 0) { 21 document.removeEventListener("scroll", lazyLoadSprite); 22 window.removeEventListener("resize", lazyLoadSprite); 23 window.removeEventListener("orientationchange", lazyLoadSprite); 24 } 25 } 26 }); 27 28 active = false; 29 }, 200); 30 } 31 }; 32 33 document.addEventListener("scroll", lazyLoadSprite); 34 window.addEventListener("resize", lazyLoadSprite); 35 window.addEventListener("orientationchange", lazyLoadSprite); 36});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.