1(function(){ 2 'use strict'; 3 4 document.addEventListener('lazybeforeunveil', function(e){ 5 var image = e.target; 6 7 if (image.tagName == 'IMG') { 8 var width = image.getAttribute('width'); 9 var height = image.getAttribute('height'); 10 if (width > 0 && height > 0) { 11 var ratio = width / height; 12 var actualWidth = image.clientWidth; 13 var actualHeight = image.clientWidth / ratio; 14 image.style.width = actualWidth + 'px'; 15 image.style.height = actualHeight + 'px'; 16 } 17 } 18 }); 19 20 document.addEventListener('lazyloaded', function(e){ 21 var image = e.target; 22 23 if (image.tagName == 'IMG') { 24 image.style.width = ''; 25 image.style.height = ''; 26 if (image.nextElementSibling && image.nextElementSibling.classList.contains('lazy-wrapper')) { 27 image.nextElementSibling.parentElement.removeChild(image.nextElementSibling); 28 } 29 } 30 }); 31})();
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.