diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index f093edef4..98a05facc 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -310,6 +310,7 @@ define([ toolbar.btnCopyStyle.on('toggle', _.bind(this.onCopyStyleToggle, this)); toolbar.mnuPageSize.on('item:click', _.bind(this.onPageSizeClick, this)); toolbar.mnuColorSchema.on('item:click', _.bind(this.onColorSchemaClick, this)); + toolbar.mnuColorSchema.on('show:after', _.bind(this.onColorSchemaShow, this)); toolbar.btnMailRecepients.on('click', _.bind(this.onSelectRecepientsClick, this)); toolbar.mnuInsertChartPicker.on('item:click', _.bind(this.onSelectChart, this)); toolbar.mnuPageNumberPosPicker.on('item:click', _.bind(this.onInsertPageNumberClick, this)); @@ -1591,6 +1592,14 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, + onColorSchemaShow: function(menu) { + if (this.api) { + var value = this.api.asc_GetCurrentColorSchemeName(); + var item = _.find(menu.items, function(item) { return item.value == value; }); + (item) ? item.setChecked(true) : menu.clearAll(); + } + }, + onDropCapSelect: function(menu, item) { if (_.isUndefined(item.value)) return; diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index e276d926b..5405dd213 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -2103,7 +2103,9 @@ define([ cls: 'color-schemas-menu', colors: schemecolors, caption: (index < 21) ? (me.SchemeNames[index] || schema.get_name()) : schema.get_name(), - value: index + value: index, + checkable: true, + toggleGroup: 'menuSchema' }); }, this); }, diff --git a/apps/documenteditor/main/resources/less/toolbar.less b/apps/documenteditor/main/resources/less/toolbar.less index db0e1ab91..eebff24e6 100644 --- a/apps/documenteditor/main/resources/less/toolbar.less +++ b/apps/documenteditor/main/resources/less/toolbar.less @@ -84,6 +84,18 @@ vertical-align: middle; } } + &.checked { + &:before { + display: none !important; + } + &, &:hover, &:focus { + background-color: @primary; + color: @dropdown-link-active-color; + span.color { + border-color: rgba(255,255,255,0.5); + } + } + } } // page number position .menu-pageposition { diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index c2563c927..385c1db34 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -307,6 +307,7 @@ define([ toolbar.btnClearStyle.on('click', _.bind(this.onClearStyleClick, this)); toolbar.btnCopyStyle.on('toggle', _.bind(this.onCopyStyleToggle, this)); toolbar.btnColorSchemas.menu.on('item:click', _.bind(this.onColorSchemaClick, this)); + toolbar.btnColorSchemas.menu.on('show:after', _.bind(this.onColorSchemaShow, this)); toolbar.btnSlideSize.menu.on('item:click', _.bind(this.onSlideSize, this)); toolbar.mnuInsertChartPicker.on('item:click', _.bind(this.onSelectChart, this)); toolbar.listTheme.on('click', _.bind(this.onListThemeSelect, this)); @@ -1531,6 +1532,14 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, + onColorSchemaShow: function(menu) { + if (this.api) { + var value = this.api.asc_GetCurrentColorSchemeName(); + var item = _.find(menu.items, function(item) { return item.value == value; }); + (item) ? item.setChecked(true) : menu.clearAll(); + } + }, + onSlideSize: function(menu, item) { if (item.value !== 'advanced') { var portrait = (this.currentPageSize.height > this.currentPageSize.width); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index e069b85c9..75546181f 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1324,7 +1324,9 @@ define([ cls: 'color-schemas-menu', colors: schemecolors, caption: (index < 21) ? (me.schemeNames[index] || schema.get_name()) : schema.get_name(), - value: index + value: index, + checkable: true, + toggleGroup: 'menuSchema' }); }, this); } diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index cf734ba8a..ac88ce931 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -71,6 +71,18 @@ vertical-align: middle; } } + &.checked { + &:before { + display: none !important; + } + &, &:hover, &:focus { + background-color: @primary; + color: @dropdown-link-active-color; + span.color { + border-color: rgba(255,255,255,0.5); + } + } + } } // menu zoom diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 2682dbab5..3ca475bb1 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -332,6 +332,7 @@ define([ toolbar.btnCopyStyle.on('toggle', _.bind(this.onCopyStyleToggle, this)); toolbar.btnDeleteCell.menu.on('item:click', _.bind(this.onCellDeleteMenu, this)); toolbar.btnColorSchemas.menu.on('item:click', _.bind(this.onColorSchemaClick, this)); + toolbar.btnColorSchemas.menu.on('show:after', _.bind(this.onColorSchemaShow, this)); toolbar.cmbFontName.on('selected', _.bind(this.onFontNameSelect, this)); toolbar.cmbFontName.on('show:after', _.bind(this.onComboOpen, this, true)); toolbar.cmbFontName.on('hide:after', _.bind(this.onHideMenus, this)); @@ -1340,6 +1341,14 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, + onColorSchemaShow: function(menu) { + if (this.api) { + var value = this.api.asc_GetCurrentColorSchemeName(); + var item = _.find(menu.items, function(item) { return item.value == value; }); + (item) ? item.setChecked(true) : menu.clearAll(); + } + }, + onComboBlur: function() { Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 71747782c..9b7168ecf 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1957,7 +1957,9 @@ define([ cls : 'color-schemas-menu', colors : schemecolors, caption : (index < 21) ? (me.SchemeNames[index] || schema.get_name()) : schema.get_name(), - value : index + value : index, + checkable: true, + toggleGroup: 'menuSchema' }); }, this); }, diff --git a/apps/spreadsheeteditor/main/resources/less/toolbar.less b/apps/spreadsheeteditor/main/resources/less/toolbar.less index ae498bc86..dd9487243 100644 --- a/apps/spreadsheeteditor/main/resources/less/toolbar.less +++ b/apps/spreadsheeteditor/main/resources/less/toolbar.less @@ -59,6 +59,18 @@ vertical-align: middle; } } + &.checked { + &:before { + display: none !important; + } + &, &:hover, &:focus { + background-color: @primary; + color: @dropdown-link-active-color; + span.color { + border-color: rgba(255,255,255,0.5); + } + } + } } // menu zoom