[DE] List settings: add "like a text" color

This commit is contained in:
Julia Radzhabova 2019-12-18 17:42:01 +03:00
parent b840659ac2
commit 11b383e773
2 changed files with 30 additions and 1 deletions

View file

@ -135,6 +135,13 @@ define([
menu : new Common.UI.Menu({
additionalAlign: this.menuAddAlign,
items: [
{
id: 'id-dlg-bullet-text-color',
caption: this.txtLikeText,
checkable: true,
toggleGroup: 'list-settings-color'
},
{caption: '--'},
{
id: 'id-dlg-bullet-auto-color',
caption: this.textAuto,
@ -156,6 +163,7 @@ define([
this.btnColor.render($window.find('#id-dlg-bullet-color'));
$window.find('#id-dlg-bullet-color-new').on('click', _.bind(this.addNewColor, this, this.colors));
$window.find('#id-dlg-bullet-auto-color').on('click', _.bind(this.onAutoColor, this));
$window.find('#id-dlg-bullet-text-color').on('click', _.bind(this.onLikeTextColor, this));
this.menuAddAlign = function(menuRoot, left, top) {
var self = this;
@ -341,6 +349,7 @@ define([
var clr_item = this.btnColor.menu.$el.find('#id-dlg-bullet-auto-color > a');
!clr_item.hasClass('selected') && clr_item.addClass('selected');
this.isAutoColor = true;
this.btnColor.menu.items[0].setChecked(false, true);
if (this._changedProps) {
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
var color = new Asc.asc_CColor();
@ -352,6 +361,22 @@ define([
}
},
onLikeTextColor: function(e) {
var color = Common.Utils.ThemeColor.getHexColor(255, 255, 255);
this.btnColor.setColor(color);
this.colors.clearSelection();
var clr_item = this.btnColor.menu.$el.find('#id-dlg-bullet-auto-color > a');
clr_item.removeClass('selected');
this.isAutoColor = false;
if (this._changedProps) {
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
this._changedProps.get_TextPr().put_Color(undefined);
}
if (this.api) {
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this.props);
}
},
onColorsSelect: function(picker, color) {
this.btnColor.setColor(color);
if (this._changedProps) {
@ -359,6 +384,7 @@ define([
this._changedProps.get_TextPr().put_Color(Common.Utils.ThemeColor.getRgbColor(color));
}
this.isAutoColor = false;
this.btnColor.menu.items[0].setChecked(false, true);
if (this.api) {
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this.props);
}
@ -471,6 +497,7 @@ define([
this.bulletProps.font = textPr.get_FontFamily();
var color = textPr.get_Color();
this.btnColor.menu.items[0].setChecked(color===undefined, true);
if (color && !color.get_auto()) {
if ( typeof(color) == 'object' ) {
var isselected = false;
@ -492,8 +519,9 @@ define([
!clr_item.hasClass('selected') && clr_item.addClass('selected');
color = '000000';
this.isAutoColor = true;
} else
} else {
color = 'ffffff';
}
}
this.btnColor.setColor(color);
}

View file

@ -172,6 +172,7 @@
}
#id-toolbar-menu-auto-fontcolor > a.selected,
#id-dlg-bullet-auto-color > a.selected,
#control-settings-system-color > a.selected,
#control-settings-system-color > a:hover {
span {