Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/landing/ui/button/ |
Upload File : |
(function(){"use strict";BX.namespace("BX.Landing.UI.Button");BX.Landing.UI.Button.TableColorAction=function(t,o,n){BX.Landing.UI.Button.EditorAction.apply(this,arguments);this.id=t;this.options=o;this.textNode=n;if(this.id!=="tableBgColor"){BX.Dom.addClass(this.layout,"landing-ui-button-editor-action-color")}const i=BX.Landing.UI.Panel.EditorPanel.getInstance().isOutOfFrame()?window.parent:window;this.colorPicker=new i.BX.Landing.UI.Tool.ColorPicker(this,this.onColorSelected.bind(this));BX.Landing.UI.Button.TableColorAction.instances.push(this)};BX.Landing.UI.Button.TableColorAction.instances=[];BX.Landing.UI.Button.TableColorAction.hideAll=function(){BX.Landing.UI.Button.TableColorAction.instances.forEach((t=>{t.colorPicker.hide()}))};BX.Landing.UI.Button.TableColorAction.prototype={constructor:BX.Landing.UI.Button.TableColorAction,__proto__:BX.Landing.UI.Button.EditorAction.prototype,onClick(t){t.preventDefault();t.stopPropagation();const o=BX.Landing.UI.Panel.EditorPanel.getInstance().isFixed()?"fixed":"relative";if(this.colorPicker.isShown()){this.colorPicker.hide()}else{this.colorPicker.show(o);if(BX.Landing.UI.Button.ChangeTag.menu){BX.Landing.UI.Button.ChangeTag.menu.close()}}},onColorSelected(t){if(this.id==="tableTextColor"){this.applyColorInTableCells(t)}if(this.id==="tableBgColor"){this.applyBgInTableCells(t)}},applyColorInTableCells(t){const o=[...this.options.setTd];o.forEach((o=>{if(o.nodeType===1){BX.Dom.style(o,"color",t)}}));if(this.options.target==="table"){this.options.table.setAttribute("text-color",t)}},prepareOptionsForApplyColorInTableCells(t,o){this.options=o;this.applyColorInTableCells(t)},applyBgInTableCells(t){const o=[...this.options.setTd];o.forEach((o=>{if(o.nodeType===1&&!BX.Dom.hasClass(o,"landing-table-col-dnd")&&!BX.Dom.hasClass(o,"landing-table-row-dnd")&&!BX.Dom.hasClass(o,"landing-table-th-select-all")){BX.Dom.style(o,"background-color",t)}}));if(this.options.target==="table"){this.options.table.setAttribute("bg-color",t)}},setContextDocument(t){BX.Landing.UI.Button.EditorAction.prototype.setContextDocument.apply(this,arguments);this.colorPicker.setContextDocument(t)}}})(); //# sourceMappingURL=table_color_button.map.js