diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index dda1210ca..428ed6ffc 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1015,13 +1015,13 @@ define([ onChangeSdtGlobalSettings: function() { var show = this.api.asc_GetGlobalContentControlShowHighlight(); - this.toolbar.mnuNoControlsColor.setChecked(!show, true); - this.toolbar.mnuControlsColorPicker.clearSelection(); + this.toolbar.mnuNoControlsColor && this.toolbar.mnuNoControlsColor.setChecked(!show, true); + this.toolbar.mnuControlsColorPicker && this.toolbar.mnuControlsColorPicker.clearSelection(); if (show){ var clr = this.api.asc_GetGlobalContentControlHighlightColor(); if (clr) { clr = Common.Utils.ThemeColor.getHexColor(clr.get_r(), clr.get_g(), clr.get_b()); - this.toolbar.mnuControlsColorPicker.selectByRGB(clr, true); + this.toolbar.mnuControlsColorPicker && this.toolbar.mnuControlsColorPicker.selectByRGB(clr, true); } } }, @@ -3101,6 +3101,7 @@ define([ me.toolbar.addTab(tab, $panel, 4); me.toolbar.setVisible('forms', true); Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons()); + me.onChangeSdtGlobalSettings(); } } }, diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index 32102f230..541b789b5 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -204,7 +204,8 @@ define([ me.mnuNoFormsColor = new Common.UI.MenuItem({ id: 'id-toolbar-menu-no-highlight-form', caption: me.textNoHighlight, - checkable: true + checkable: true, + checked: me.btnHighlight.currentColor === null }), {caption: '--'}, {template: _.template('
')}, @@ -217,7 +218,8 @@ define([ '808000', '00FF00', '008080', '0000FF', '666699', '808080', 'FF0000', 'FF9900', '99CC00', '339966', '33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF', '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', '99CCFF', 'CC99FF', 'FFFFFF' - ] + ], + value: me.btnHighlight.currentColor }); var colorVal = $(''); $('button:first-child', me.btnHighlight.cmpEl).append(colorVal);