Current Path : /home/bitrix/vorobey-clubru/bitrix/js/main/spotlight/ |
Current File : /home/bitrix/vorobey-clubru/bitrix/js/main/spotlight/spotlight.min.js |
(function(){"use strict";BX.namespace("BX.SpotLight");BX.SpotLight=function(t){this.container=null;this.popup=null;this.options=t;if(!BX.type.isDomNode(t.renderTo)){throw new Error("BX.SpotLight: 'renderTo' is not a DOMNode.")}this.renderTo=t.renderTo;if(t.top){if(!BX.type.isNumber(t.top)){throw new Error("BX.SpotLight: 'top' is not a number.")}this.top=t.top}else{this.top=null}if(t.left){if(!BX.type.isNumber(t.left)){throw new Error("BX.SpotLight: 'left' is not a number.")}this.left=t.left}else{this.left=null}if(t.lightMode){if(!BX.type.isBoolean(t.lightMode)){throw new Error("BX.SpotLight: 'lightMode' is not a boolean.")}this.lightMode=t.lightMode}else{this.lightMode=null}if(t.remind){if(!BX.type.isBoolean(t.remind)){throw new Error("BX.SpotLight: 'remind' is not a boolean.")}this.remind=t.remind}t.content?this.content=t.content:this.content=null};BX.SpotLight.prototype={getDomElement:function(){return BX.pos(this.renderTo)},getPopup:function(){if(this.popup){return this.popup}this.popup=new BX.PopupWindow(" ",this.container,{className:"main-spot-light-popup",angle:{position:top,offset:41},autoHide:true,overlay:true,content:this.content?this.content:null,events:{onPopupClose:function(){this.popup.destroy();this.container.parentNode.removeChild(this.container)}.bind(this)},buttons:[new BX.PopupWindowCustomButton({text:BX.message("MAIN_SPOTLIGHT_UNDERSTAND"),className:"webform-small-button webform-small-button-blue",events:{click:function(){this.popup.destroy();this.container.parentNode.removeChild(this.container);BX.onCustomEvent(this,"spotLightOk",[this.renderTo,this])}.bind(this)}}),this.remind?new BX.PopupWindowCustomButton({text:BX.message("MAIN_SPOTLIGHT_REMIND_LATER"),className:"main-spot-light-remind-later",events:{click:function(){this.popup.destroy();this.container.parentNode.removeChild(this.container);BX.onCustomEvent(this,"spotLightLater",[this.renderTo,this])}.bind(this)}}):null]});return this.popup},createContainer:function(){if(this.container){return this.container}this.container=BX.create("div",{attrs:{className:this.lightMode?"main-spot-light main-spot-light-white":"main-spot-light"},style:{top:this.top?this.getDomElement().top+this.top+"px":this.getDomElement().top+"px",left:this.left?this.getDomElement().left+this.left+"px":this.getDomElement().left+"px"},events:this.content?{mouseenter:function(){this.getPopup().show()}.bind(this)}:null});return this.container},show:function(){document.body.appendChild(this.createContainer())}}})(); //# sourceMappingURL=spotlight.map.js