1(function () { 2 class BreakdanceLazyLoad { 3 constructor(element) { 4 this.element = element; 5 this.init(); 6 } 7 8 init() { 9 if (this.element.getAttribute('data-bde-lazy-bg') === 'waiting') { 10 this.observer = new IntersectionObserver((entries, observer) => { 11 entries.forEach(entry => { 12 if (entry.isIntersecting) { 13 this.loadBackground(); 14 observer.unobserve(entry.target); 15 } 16 }); 17 }); 18 19 this.observer.observe(this.element); 20 } 21 } 22 23 loadBackground() { 24 this.element.setAttribute('data-bde-lazy-bg', 'loaded'); 25 } 26 27 destroy() { 28 if (this.observer) { 29 this.observer.unobserve(this.element); 30 this.observer = null; 31 } 32 } 33 34 static autoload(parent = null) { 35 const container = parent ?? document; 36 const selector = "[data-bde-lazy-bg]"; 37 const elements = container.querySelectorAll(selector); 38 39 elements.forEach((element) => new this(element)); 40 } 41 } 42 43 document.addEventListener("DOMContentLoaded", () => 44 BreakdanceLazyLoad.autoload() 45 ); 46 47 window.BreakdanceLazyLoad = BreakdanceLazyLoad; 48})();
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.