Your IP : 18.223.100.85


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

this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};(function(e,t){"use strict";class s extends t.Base{constructor(e){super(e);this.data=BX.Landing.Utils.data;this.type="embed";this.attribute=["data-src","data-source","data-preview"];this.onAttributeChangeHandler=e.onAttributeChange||function(){};this.lastValue=this.getValue();this.nodeContainer=this.node.closest(BX.Landing.Node.Embed.CONTAINER_SELECTOR)}onChange(e){this.lastValue=this.getValue();this.onAttributeChangeHandler(this);this.onChangeHandler(this,e)}isChanged(){return JSON.stringify(this.getValue())!==JSON.stringify(this.lastValue)}getValue(){var e;const t=this.nodeContainer?BX.Landing.Node.Embed.RATIO_CLASSES.find((e=>BX.Dom.hasClass(this.nodeContainer,e))):"";return{src:(e=this.node.src)!=null?e:this.data(this.node,"data-src"),source:this.data(this.node,"data-source"),preview:this.data(this.node,"data-preview"),ratio:t||""}}setValue(e,t,s){if(this.node.src){this.node.src=e.src}else{this.data(this.node,"data-src",e.src)}this.data(this.node,"data-source",e.source);if(e.preview){this.data(this.node,"data-preview",e.preview);BX.Dom.style(this.node,"background-image",`url("${e.preview}")`)}else{this.data(this.node,"data-preview",null);BX.Dom.style(this.node,"background-image","")}if(e.src&&e.ratio&&this.lastValue.src!==e.src&&BX.Landing.Node.Embed.RATIO_CLASSES.includes(e.ratio)&&this.nodeContainer){BX.Landing.Node.Embed.RATIO_CLASSES.forEach((t=>{if(e.ratio===t){BX.Dom.addClass(this.nodeContainer,t)}else{BX.Dom.removeClass(this.nodeContainer,t)}}))}if(this.isChanged()){if(!s){BX.Landing.History.getInstance().push()}this.onChange(s)}}getField(){const e={title:this.manifest.name,selector:this.selector,content:this.getValue()};if(BX.Dom.hasClass(this.node.parentNode,"bg-video__inner")){return new BX.Landing.UI.Field.EmbedBg(e)}return new BX.Landing.UI.Field.Embed(e)}}BX.Landing.Node.Embed=s;BX.Landing.Node.Embed.CONTAINER_SELECTOR=".embed-responsive";BX.Landing.Node.Embed.RATIO_CLASSES=["embed-responsive-16by9","embed-responsive-9by16","embed-responsive-4by3","embed-responsive-3by4","embed-responsive-21by9","embed-responsive-9by21","embed-responsive-1by1"];BX.Landing.Node.Embed.DEFAULT_RATIO_V="embed-responsive-9by16";BX.Landing.Node.Embed.DEFAULT_RATIO_H="embed-responsive-16by9";e.Embed=s})(this.BX.Landing.Node=this.BX.Landing.Node||{},BX.Landing.Node);
//# sourceMappingURL=embed.bundle.map.js