Current Path : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/landing/ui/panel/ |
Current File : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/landing/ui/panel/base_panel.min.js |
(function(){"use strict";BX.namespace("BX.Landing.UI.Panel");BX.Landing.UI.Panel.BasePanel=function(n){this.id=BX.type.isNotEmptyString(n)?n:BX.Landing.UI.Panel.BasePanel.makeId();this.layout=BX.Landing.UI.Panel.BasePanel.createLayout(this.id);this.classShow="landing-ui-show";this.classHide="landing-ui-hide";this.forms=new BX.Landing.UI.Collection.FormCollection};BX.Landing.UI.Panel.BasePanel.makeId=function(){return"landing_ui_panel_"+ +new Date};BX.Landing.UI.Panel.BasePanel.createLayout=function(n){return BX.create("div",{props:{className:"landing-ui-panel landing-ui-hide"},attrs:{"data-id":n}})};BX.Landing.UI.Panel.BasePanel.prototype={show:function(){if(!this.isShown()){return BX.Landing.Utils.Show(this.layout)}return Promise.resolve()},hide:function(){if(this.isShown()){return BX.Landing.Utils.Hide(this.layout)}return Promise.resolve()},isShown:function(){return this.layout.classList.contains(this.classShow)&&!this.layout.classList.contains(this.classHide)||!this.layout.classList.contains(this.classShow)&&!this.layout.classList.contains(this.classHide)},setContent:function(n){this.layout.innerHTML="";if(BX.type.isNotEmptyString(n)){this.layout.innerHTML=n}if(BX.type.isDomNode(n)){this.appendContent(n)}if(BX.type.isArray(n)){n.forEach(this.appendContent,this)}},appendContent:function(n){if(BX.type.isDomNode(n)){this.layout.appendChild(n)}},prependContent:function(n){if(BX.type.isDomNode(n)){BX.prepend(n,this.layout)}},remove:function(){BX.remove(this.layout)},appendForm:function(n){this.layout.appendChild(n.getNode())},clear:function(){this.layout.innerHTML=""}}})(); //# sourceMappingURL=base_panel.map.js