Your IP : 3.135.205.24


Current Path : /var/www/u0635749/data/www/hobbyclick.ru/public/bitrix/js/sender/agreement/
Upload File :
Current File : /var/www/u0635749/data/www/hobbyclick.ru/public/bitrix/js/sender/agreement/script.min.js

(function(){BX.namespace("BX.Sender");if(BX.Sender.Agreement){return}function t(){this.actionUri="/bitrix/components/bitrix/sender.letter.list/ajax.php";this.isAccepted=!BX.message.SENDER_AGREEMENT_IS_REQUIRED;if(!this.isAccepted){var t=this;BX.ready(function(){t.showPopup()})}this.ajaxAction=new BX.AjaxAction(this.actionUri)}t.prototype.onApply=function(){this.isAccepted=true;var t="popup-window-button-wait";this.button.addClassName(t);var e=this;this.ajaxAction.request({action:"acceptAgreement",onsuccess:function(){BX.Event.EventEmitter.emit("BX.Sender.Agreement:onAccept");e.popup.close()},onfailure:function(){e.popup.show();e.button.removeClassName(t)}})};t.prototype.onClose=function(){if(this.isAccepted){return}top.location.href="/";setTimeout(this.popup.show.bind(this.popup),0)};t.prototype.showPopup=function(){if(!this.popup){this.button=new BX.PopupWindowButton({text:BX.message("SENDER_AGREEMENT_BUTTON_ACCEPT"),className:"popup-window-button-accept",events:{click:this.onApply.bind(this)}});this.popup=BX.PopupWindowManager.create("sender-agreement-popup",null,{content:'<div class="sender-agreement-wrap">'+BX.message("SENDER_AGREEMENT_TEXT")+"</div>",titleBar:BX.message("SENDER_AGREEMENT_TITLE"),maxHeight:400,maxWidth:860,autoHide:false,lightShadow:false,overlay:{opacity:500,backgroundColor:"black"},closeByEsc:false,closeIcon:true,buttons:[this.button],events:{onPopupClose:this.onClose.bind(this)}})}if(this.popup.isShown()){return}this.popup.show()};BX.Sender.Agreement=new t})(window);
//# sourceMappingURL=script.map.js