Your IP : 18.226.96.202


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

this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};(function(t,e){"use strict";class i{constructor(){this.popup=null;this.nodeEditSubmit=null;this.nodeEditLi=[];this.content=[];const t=BX.findChildren(this.node,{tag:"li"});for(let e=0,i=t.length;e<i;e++){let i="";for(let n=0,o=t[e].childNodes.length;n<o;n++){if(t[e].childNodes[n].nodeType===1&&(t[e].childNodes[n].tagName==="B"||t[e].childNodes[n].tagName==="I"||t[e].childNodes[n].tagName==="U")){i+=t[e].childNodes[n].outerHTML}else if(t[e].childNodes[n].nodeType===3&&BX.util.trim(t[e].childNodes[n].textContent)!==""){i+=" #VAL# "}}this.content.push({content:BX.util.trim(t[e].textContent),original:i})}BX.bind(this.node,"click",BX.delegate(this.onClick,this))}saveContent(){let t=false;let i=true;for(let n=0,o=this.nodeEditLi.length;n<o;n++){if(this.nodeEditLi[n]===null){t=true;break}else{const o=BX.util.trim(this.nodeEditLi[n].value);i=false;if(e.Type.isUndefined(this.content[n])||this.content[n].content!==o){t=true;break}}}if(!i&&t){BX.cleanNode(this.node);this.content=[];for(let t=0,e=this.nodeEditLi.length;t<e;t++){if(this.nodeEditLi[t]===null){this.content.push(false)}else{const e=BX.util.trim(this.nodeEditLi[t].value);const i=BX.data(this.nodeEditLi[t],"original");this.content.push({content:e,original:i});this.node.appendChild(BX.create("li",{html:i.replace("#VAL#",BX.util.htmlspecialchars(e))}))}}this.markAsChanged()}}getAddLiButton(t){return BX.create("input",{attrs:{type:"button",value:"+"},dataset:{i:t},events:{click:BX.delegate((function(){const e=BX.proxy_context;const i=parseInt(BX.data(e,"i"),10);const n=BX.create("input",{dataset:{original:this.content[t].original},attrs:{type:"text"}});BX.insertAfter(BX.create("div",{children:[n,this.getAddLiButton(i+1),this.getRemoveLiButton(i+1)]}),e.parentNode);this.nodeEditLi.splice(i+1,0,n);BX.focus(n)}),this)}})}getRemoveLiButton(t){return BX.create("input",{attrs:{type:"button",value:"-"},dataset:{i:t},events:{click:BX.delegate((function(){const t=BX.proxy_context;this.nodeEditLi[BX.data(t,"i")]=null;BX.remove(t.parentNode)}),this)}})}getEditNodes(t){let e=[];const i=[];this.nodeEditLi=[];for(let t=0,n=this.content.length;t<n;t++){e=BX.create("input",{dataset:{original:this.content[t].original},attrs:{type:"text",value:BX.util.trim(this.content[t].content)}});this.nodeEditLi.push(e);i.push(BX.create("div",{children:[e,this.getAddLiButton(t),this.getRemoveLiButton(t)]}))}if(t!==false){this.nodeEditSubmit=BX.create("input",{attrs:{type:"button",value:"Save"},events:{click:function(){this.saveContent();this.popup.close()}.bind(this)}})}if(t!==false){i.push(this.nodeEditSubmit)}return i}onClick(t){this.popup=BX.PopupWindowManager.create("landing_node_img",BX.proxy_context,{closeIcon:false,autoHide:true,closeByEsc:true,contentColor:"white",angle:true,offsetLeft:15,overlay:{backgroundColor:"#cdcdcd",opacity:".1"},events:{onPopupClose:function(){this.popup.destroy()}.bind(this)}});this.popup.setContent(BX.create("div",{children:this.getEditNodes()}));this.popup.show();return BX.PreventDefault(t)}getSettingsForm(){return[{name:this.getName(),node:BX.create("div",{children:this.getEditNodes(false)})}]}getValue(){}setValue(){}getField(){return new BX.Landing.UI.Field.BaseField({selector:this.selector,title:this.manifest.name})}}t.Ul=i})(this.BX.Landing.Node=this.BX.Landing.Node||{},BX);
//# sourceMappingURL=ul.bundle.map.js