Your IP : 3.145.15.138


Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/ui/button/
Upload File :
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/ui/button/create_table.min.js

(function(){"use strict";BX.namespace("BX.Landing.UI.Button");BX.Landing.UI.Button.CreateTable=function(t,e,n){BX.Landing.UI.Button.EditorAction.apply(this,arguments);this.editPanel=null;this.options=e;this.id=t;this.textNode=n};BX.Landing.UI.Button.CreateTable.prototype={constructor:BX.Landing.UI.Button.CreateTable,__proto__:BX.Landing.UI.Button.EditorAction.prototype,onClick(t){t.preventDefault();t.stopPropagation();const e="rgb(51, 51, 51)";const n="#333333";const d=this.contextDocument.createElement("div");d.classList.add("landing-table-container");const l=this.contextDocument.createElement("table");l.classList.add("landing-table","landing-table-style-1");l.setAttribute("text-color",n);const o=this.contextDocument.createElement("tr");o.classList.add("landing-table-tr");const i=this.contextDocument.createElement("tr");i.classList.add("landing-table-tr");const a=this.contextDocument.createElement("th");a.classList.add("landing-table-th","landing-table-row-dnd");const c=this.contextDocument.createElement("div");c.classList.add("landing-table-row-add");const s=this.contextDocument.createElement("div");s.classList.add("landing-table-row-add-line");const r=this.contextDocument.createElement("div");r.classList.add("landing-table-div-row-dnd");c.appendChild(s);const h=this.contextDocument.createElement("td");h.classList.add("landing-table-th","landing-table-td");const u=this.getCellWidth();h.style.width=`${u}px`;h.style.color=e;const p=this.contextDocument.createElement("th");p.classList.add("landing-table-th","landing-table-col-dnd");p.style.width=`${u}px`;const m=this.contextDocument.createElement("div");m.classList.add("landing-table-div-col-dnd");const g=this.contextDocument.createElement("div");g.classList.add("landing-table-col-resize");const b=this.contextDocument.createElement("div");b.classList.add("landing-table-col-add");const C=this.contextDocument.createElement("div");C.classList.add("landing-table-col-add-line");b.appendChild(C);const x=this.contextDocument.createElement("th");x.classList.add("landing-table-th","landing-table-th-select-all");x.style.width="16px";const L=this.contextDocument.createElement("div");L.classList.add("th-tech-icon");o.appendChild(x.cloneNode(true));for(var E=0;E<=3;E++){o.appendChild(p.cloneNode(true))}i.appendChild(a.cloneNode(true));for(var E=0;E<=3;E++){i.appendChild(h.cloneNode(true))}l.appendChild(o.cloneNode(true));for(var E=0;E<=3;E++){l.appendChild(i.cloneNode(true))}d.appendChild(l);const f=this.contextDocument.createElement("div");d.id="new-table";f.appendChild(d);this.contextDocument.execCommand("insertHTML",null,f.innerHTML);const v=this.contextDocument.getElementById("new-table");const D=v.querySelector(".landing-table-th-select-all");if(D.firstChild){D.firstChild.remove()}D.appendChild(L.cloneNode(true));const N=v.querySelectorAll(".landing-table-col-dnd");N.forEach((t=>{if(t.firstChild){t.firstChild.remove()}t.appendChild(m.cloneNode(true));t.appendChild(g.cloneNode(true));t.appendChild(b.cloneNode(true))}));const B=v.querySelectorAll(".landing-table-row-dnd");B.forEach((t=>{if(t.firstChild){t.firstChild.remove()}t.appendChild(c.cloneNode(true));t.appendChild(r.cloneNode(true))}));v.removeAttribute("id");if(this.textNode){this.textNode.onChange(true)}},getCellWidth(){const t=250;const e=1e3;const n=57;const d=4;let l=t;if(BX.Landing.Node.Text.currentNode){const t=BX.Landing.Node.Text.currentNode.node.getBoundingClientRect().width;if(t<e){l=Math.floor((t-n)/d)}}return l}}})();
//# sourceMappingURL=create_table.map.js