Show current color scheme

This commit is contained in:
Julia Radzhabova 2019-08-20 15:56:29 +03:00
parent 6c39a8dbfa
commit 61ed3059e2
9 changed files with 72 additions and 3 deletions

View file

@ -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;

View file

@ -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);
},

View file

@ -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 {

View file

@ -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);

View file

@ -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);
}

View file

@ -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

View file

@ -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);
},

View file

@ -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);
},

View file

@ -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