Your IP : 18.191.223.30


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/style_table.min.js

(function(){"use strict";BX.namespace("BX.Landing.UI.Button");BX.Landing.UI.Button.StyleTable=function(t,e,n){BX.Landing.UI.Button.EditorAction.apply(this,arguments);this.options=e;this.textNode=n};BX.Landing.UI.Button.StyleTable.prototype={constructor:BX.Landing.UI.Button.StyleTable,__proto__:BX.Landing.UI.Button.EditorAction.prototype,onClick(t){t.preventDefault();t.stopPropagation();const e=this.options.table;const n=[];n.table=e;n.setTd=this.options.setTd;n.target=this.options.target;if(!this.menu){this.menu=new BX.PopupMenuWindow({id:`change-table-style-menu-${BX.Text.getRandom()}`,bindElement:this.layout,zIndex:-678,events:{onPopupClose:function(){this.textNode.onChange(true)}.bind(this)},items:[new BX.PopupMenuItem({id:"style1",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_1"),onclick:this.onChangeStyle,table:e,options:n}),new BX.PopupMenuItem({id:"style2",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_2"),onclick:this.onChangeStyle,table:e,options:n}),new BX.PopupMenuItem({id:"style3",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_3"),onclick:this.onChangeStyle,table:e,options:n}),new BX.PopupMenuItem({id:"style4",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_4"),onclick:this.onChangeStyle,table:e,options:n}),new BX.PopupMenuItem({id:"style5",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_5"),onclick:this.onChangeStyle,table:e,options:n}),new BX.PopupMenuItem({id:"style6",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_6"),onclick:this.onChangeStyle,table:e,options:n}),new BX.PopupMenuItem({id:"style7",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_7"),onclick:this.onChangeStyle,table:e,options:n}),new BX.PopupMenuItem({id:"style8",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_8"),onclick:this.onChangeStyle,table:e,options:n}),new BX.PopupMenuItem({id:"style9",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_9"),onclick:this.onChangeStyle,table:e,options:n}),new BX.PopupMenuItem({id:"style10",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_10"),onclick:this.onChangeStyle,table:e,options:n})]})}this.menuItems=this.menu.menuItems;if(BX.Dom.hasClass(e,"landing-table-style-1")){BX.Dom.style(this.menuItems[0].layout.item,"font-weight","bold")}if(BX.Dom.hasClass(e,"landing-table-style-2")){BX.Dom.style(this.menuItems[1].layout.item,"font-weight","bold")}if(BX.Dom.hasClass(e,"landing-table-style-3")){BX.Dom.style(this.menuItems[2].layout.item,"font-weight","bold")}if(BX.Dom.hasClass(e,"landing-table-style-4")){BX.Dom.style(this.menuItems[3].layout.item,"font-weight","bold")}if(BX.Dom.hasClass(e,"landing-table-style-5")){BX.Dom.style(this.menuItems[4].layout.item,"font-weight","bold")}if(BX.Dom.hasClass(e,"landing-table-style-6")){BX.Dom.style(this.menuItems[5].layout.item,"font-weight","bold")}if(BX.Dom.hasClass(e,"landing-table-style-7")){BX.Dom.style(this.menuItems[6].layout.item,"font-weight","bold")}if(BX.Dom.hasClass(e,"landing-table-style-8")){BX.Dom.style(this.menuItems[7].layout.item,"font-weight","bold")}if(BX.Dom.hasClass(e,"landing-table-style-9")){BX.Dom.style(this.menuItems[8].layout.item,"font-weight","bold")}if(BX.Dom.hasClass(e,"landing-table-style-10")){BX.Dom.style(this.menuItems[9].layout.item,"font-weight","bold")}if(this.menu.popupWindow.isShown()){this.menu.close();BX.Dom.style(this.menu.popupWindow.popupContainer,"top",`${parseInt(BX.Dom.style(this.menu.popupWindow.popupContainer,"top"),10)+60}px`)}else{this.menu.show();BX.Dom.style(this.menu.popupWindow.popupContainer,"top",`${parseInt(BX.Dom.style(this.menu.popupWindow.popupContainer,"top"),10)-60}px`)}},onChangeStyle(e,n){e.stopPropagation();n.menuWindow.close();let o="";let s="";const l=["landing-table-style-1","landing-table-style-2","landing-table-style-3","landing-table-style-4","landing-table-style-5","landing-table-style-6","landing-table-style-7","landing-table-style-8","landing-table-style-9","landing-table-style-10"];switch(n.id){case"style1":o=l[0];s=0;break;case"style2":o=l[1];s=1;break;case"style3":o=l[2];s=2;break;case"style4":o=l[3];s=3;break;case"style5":o=l[4];s=4;break;case"style6":o=l[5];s=5;break;case"style7":o=l[6];s=6;break;case"style8":o=l[7];s=7;break;case"style9":o=l[8];s=8;break;case"style10":o=l[9];s=9;break;default:break}if(o!==undefined){let e=0;this.menuItems.forEach((t=>{if(e===s){BX.Dom.style(t.layout.item,"font-weight","bold")}else{BX.Dom.style(t.layout.item,"font-weight","normal")}e++}));t.applyTableStyles(l,o,s,n)}},applyTableStyles(t,e,n,o){t.forEach((t=>{if(t===e){BX.Dom.addClass(o.table,t);if(n>=5){const t="#ccc";BX.Landing.UI.Button.TableColorAction.prototype.prepareOptionsForApplyColorInTableCells(t,o.options.options.options)}if(n<5){const t="#333";BX.Landing.UI.Button.TableColorAction.prototype.prepareOptionsForApplyColorInTableCells(t,o.options.options.options)}}else{BX.Dom.removeClass(o.table,t)}}))}};const t=new BX.Landing.UI.Button.StyleTable})();
//# sourceMappingURL=style_table.map.js