Current Path : /var/www/axolotl/data/www/yar.axolotls.ru/bitrix/js/ui/info-helper/ |
Current File : /var/www/axolotl/data/www/yar.axolotls.ru/bitrix/js/ui/info-helper/info-helper.min.js |
BX.namespace("BX.UI");BX.UI.InfoHelper={frameUrlTemplate:"",frameNode:null,popupLoader:null,frameUrl:"",init:function(e){this.frameUrlTemplate=e.frameUrlTemplate||"";BX.bind(window,"message",BX.proxy(function(e){if(!!e.origin&&e.origin.indexOf("bitrix")===-1){return}if(!e.data||typeof e.data!=="object"){return}if(e.data.action==="ClosePage"){this.close()}if(e.data.action==="openPage"){window.location.href=this.frameUrl}if(e.data.action==="openPageInNewTab"){window.open(this.frameUrl,"_blank")}},this))},show:function(e){if(this.isOpen()){return}if(!e){return}this.frameUrl=this.frameUrlTemplate.replace(/code/,e);if(this.getFrame().src!==this.frameUrl){this.getFrame().src=this.frameUrl}BX.SidePanel.Instance.open(this.getSliderId(),{contentCallback:function(e){var t=new BX.Promise;t.fulfill(this.getContent());return t}.bind(this),width:700,loader:"default-loader",cacheable:false,data:{rightBoundary:0},events:{onCloseComplete:function(){BX.UI.InfoHelper.close()},onLoad:function(){BX.UI.InfoHelper.showFrame()},onClose:function(){BX.UI.InfoHelper.frameNode.contentWindow.postMessage({action:"onCloseWidget"},"*")}}})},close:function(){var e=this.getSlider();if(e){e.close()}},getContent:function(){if(this.content){return this.content}this.content=BX.create("div",{attrs:{className:"info-helper-container",id:"info-helper-container"},children:[this.getLoader(),this.getFrame()]});return this.content},getFrame:function(){if(this.frameNode){return this.frameNode}this.frameNode=BX.create("iframe",{attrs:{className:"info-helper-panel-iframe",src:"about:blank"}});return this.frameNode},showFrame:function(){setTimeout(function(){this.getFrame().classList.add("info-helper-panel-iframe-show")}.bind(this),600)},getLoader:function(){if(this.popupLoader){return this.popupLoader}var e=new BX.Loader({target:BX("info-helper-container"),size:100});e.show();this.popupLoader=e.data.container;return this.popupLoader},getSliderId:function(){return"ui:info_helper"},getSlider:function(){return BX.SidePanel.Instance.getSlider(this.getSliderId())},isOpen:function(){return this.getSlider()&&this.getSlider().isOpen()}}; //# sourceMappingURL=info-helper.map.js