Your IP : 18.119.157.241


Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/main/lazyload/dist/
Upload File :
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/main/lazyload/dist/lazyload.bundle.min.js

(function(e,t){"use strict";var i={observer:null,images:{},imageStatus:{hidden:-2,error:-1,undefined:0,inited:1,loaded:2},imageTypes:{image:1,background:2},initObserver:function e(){this.observer=new IntersectionObserver(this.onIntersection.bind(this),{rootMargin:"20% 0% 20% 0%",threshold:.1})},onIntersection:function e(t){t.forEach(function(e){if(e.isIntersecting){this.showImage(e.target)}}.bind(this))},registerImage:function e(i,n,s){if(this.observer===null){this.initObserver()}s=s||{};if(!t.Type.isStringFilled(i)){return}if(t.Type.isObject(this.images[i])){return}var a=document.getElementById(i);if(!t.Type.isDomNode(a)){return}this.observer.observe(a);this.images[i]={id:i,node:null,src:null,dataSrcName:s.dataSrcName||"src",type:null,func:t.Type.isFunction(n)?n:null,status:this.imageStatus.undefined}},registerImages:function e(i,n,s){if(t.Type.isArray(i)){for(var a=0,r=i.length;a<r;a++){this.registerImage(i[a],n,s)}}},showImage:function e(i){var n=i.id;if(!t.Type.isStringFilled(n)){return}var s=this.images[n];if(!t.Type.isPlainObject(s)){return}if(s.status==this.imageStatus.undefined){this.initImage(s)}if(s.status!==this.imageStatus.inited){return}if(!s.node||!s.node.parentNode){s.node=null;s.status=this.imageStatus.error;return}if(s.type==this.imageTypes.image){s.node.src=s.src}else{s.node.style.backgroundImage="url('"+s.src+"')"}s.node.dataset[s.dataSrcName]="";s.status=this.imageStatus.loaded},showImages:function e(i){i=i!==false;for(var n in this.images){if(!this.images.hasOwnProperty(n)){continue}var s=this.images[n];if(s.status==this.imageStatus.undefined){this.initImage(s)}if(s.status!==this.imageStatus.inited){continue}if(!s.node||!s.node.parentNode){s.node=null;s.status=this.imageStatus.error;continue}var a=true;if(i&&t.Type.isFunction(s.func)){a=s.func(s)}if(a===true&&this.isElementVisibleOnScreen(s.node)){if(s.type==this.imageTypes.image){s.node.src=s.src}else{s.node.style.backgroundImage="url('"+s.src+"')"}s.node.dataset[s.dataSrcName]="";s.status=this.imageStatus.loaded}}},initImage:function e(i){i.status=this.imageStatus.error;var n=document.getElementById(i.id);if(!t.Type.isDomNode(n)){return}var s=n.dataset[i.dataSrcName];if(t.Type.isStringFilled(s)){i.node=n;i.src=s;i.status=this.imageStatus.inited;i.type=i.node.tagName.toLowerCase()=="img"?this.imageTypes.image:this.imageTypes.background}},isElementVisibleOnScreen:function e(t){var i=this.getElementCoords(t);var n=window.pageYOffset||document.documentElement.scrollTop;var s=n+document.documentElement.clientHeight;i.bottom=i.top+t.offsetHeight;return i.top>n&&i.top<s||i.bottom<s&&i.bottom>n},isElementVisibleOn2Screens:function e(t){var i=document.documentElement.clientHeight;var n=window.pageYOffset||document.documentElement.scrollTop;var s=n+i;var a=this.getElementCoords(t);a.bottom=a.top+t.offsetHeight;n-=i;s+=i;return a.top>n&&a.top<s||a.bottom<s&&a.bottom>n},getElementCoords:function e(t){var i=t.getBoundingClientRect();return{originTop:i.top,originLeft:i.left,top:i.top+window.pageYOffset,left:i.left+window.pageXOffset}},onScroll:function e(){},clearImages:function e(){this.images=[]}};e.LazyLoad=i})(this.BX=this.BX||{},BX);
//# sourceMappingURL=lazyload.bundle.map.js