Your IP : 108.162.216.192


Current Path : /var/www/element/data/www/revenuestory.ru/bitrix/js/landing/ui/button/
Upload File :
Current File : /var/www/element/data/www/revenuestory.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){BX.Landing.UI.Button.EditorAction.apply(this,arguments);this.options=e};BX.Landing.UI.Button.StyleTable.prototype={constructor:BX.Landing.UI.Button.StyleTable,__proto__:BX.Landing.UI.Button.EditorAction.prototype,onClick:function(t){t.preventDefault();t.stopPropagation();var e=this.options.table;var 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,items:[new BX.PopupMenuItem({id:"style1",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_1"),onclick:this.onChange,table:e,options:n}),new BX.PopupMenuItem({id:"style2",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_2"),onclick:this.onChange,table:e,options:n}),new BX.PopupMenuItem({id:"style3",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_3"),onclick:this.onChange,table:e,options:n}),new BX.PopupMenuItem({id:"style4",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_4"),onclick:this.onChange,table:e,options:n}),new BX.PopupMenuItem({id:"style5",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_5"),onclick:this.onChange,table:e,options:n}),new BX.PopupMenuItem({id:"style6",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_6"),onclick:this.onChange,table:e,options:n}),new BX.PopupMenuItem({id:"style7",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_7"),onclick:this.onChange,table:e,options:n}),new BX.PopupMenuItem({id:"style8",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_8"),onclick:this.onChange,table:e,options:n}),new BX.PopupMenuItem({id:"style9",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_9"),onclick:this.onChange,table:e,options:n}),new BX.PopupMenuItem({id:"style10",text:BX.Landing.Loc.getMessage("LANDING_TABLE_STYLE_10"),onclick:this.onChange,table:e,options:n})]})}var o=this.menu.menuItems;o.forEach((function(t){t.menuItems=o}));if(e.classList.contains("landing-table-style-1")){o[0].layout.item.style.fontWeight="bold"}if(e.classList.contains("landing-table-style-2")){o[1].layout.item.style.fontWeight="bold"}if(e.classList.contains("landing-table-style-3")){o[2].layout.item.style.fontWeight="bold"}if(e.classList.contains("landing-table-style-4")){o[3].layout.item.style.fontWeight="bold"}if(e.classList.contains("landing-table-style-5")){o[4].layout.item.style.fontWeight="bold"}if(e.classList.contains("landing-table-style-6")){o[5].layout.item.style.fontWeight="bold"}if(e.classList.contains("landing-table-style-7")){o[6].layout.item.style.fontWeight="bold"}if(e.classList.contains("landing-table-style-8")){o[7].layout.item.style.fontWeight="bold"}if(e.classList.contains("landing-table-style-9")){o[8].layout.item.style.fontWeight="bold"}if(e.classList.contains("landing-table-style-10")){o[9].layout.item.style.fontWeight="bold"}if(this.menu.popupWindow.isShown()){this.menu.close()}else{this.menu.show()}},onChange:function(t,e){t.stopPropagation();e.menuWindow.close();var n;var o;var s=["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(e.id){case"style1":n=s[0];o=0;break;case"style2":n=s[1];o=1;break;case"style3":n=s[2];o=2;break;case"style4":n=s[3];o=3;break;case"style5":n=s[4];o=4;break;case"style6":n=s[5];o=5;break;case"style7":n=s[6];o=6;break;case"style8":n=s[7];o=7;break;case"style9":n=s[8];o=8;break;case"style10":n=s[9];o=9;break}if(n!==undefined){var i=0;e.menuItems.forEach((function(t){if(i===o){t.layout.item.style.fontWeight="bold"}else{t.layout.item.style.fontWeight="normal"}i++}));s.forEach((function(t){if(t===n){e.table.classList.add(t);var s="#cccccc";var i="#333333";if(o>=5){BX.Landing.UI.Button.ColorAction.prototype.prepareOptionsForApplyColorInTableCells(s,e.options.options.options)}else{BX.Landing.UI.Button.ColorAction.prototype.prepareOptionsForApplyColorInTableCells(i,e.options.options.options)}}else{e.table.classList.remove(t)}}))}BX.Landing.Block.Node.Text.currentNode.onChange(true)}}})();
//# sourceMappingURL=style_table.map.js