[DE] List settings: add "like a text" color
This commit is contained in:
parent
b840659ac2
commit
11b383e773
|
@ -135,6 +135,13 @@ define([
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
additionalAlign: this.menuAddAlign,
|
additionalAlign: this.menuAddAlign,
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
id: 'id-dlg-bullet-text-color',
|
||||||
|
caption: this.txtLikeText,
|
||||||
|
checkable: true,
|
||||||
|
toggleGroup: 'list-settings-color'
|
||||||
|
},
|
||||||
|
{caption: '--'},
|
||||||
{
|
{
|
||||||
id: 'id-dlg-bullet-auto-color',
|
id: 'id-dlg-bullet-auto-color',
|
||||||
caption: this.textAuto,
|
caption: this.textAuto,
|
||||||
|
@ -156,6 +163,7 @@ define([
|
||||||
this.btnColor.render($window.find('#id-dlg-bullet-color'));
|
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-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-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) {
|
this.menuAddAlign = function(menuRoot, left, top) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
@ -341,6 +349,7 @@ define([
|
||||||
var clr_item = this.btnColor.menu.$el.find('#id-dlg-bullet-auto-color > a');
|
var clr_item = this.btnColor.menu.$el.find('#id-dlg-bullet-auto-color > a');
|
||||||
!clr_item.hasClass('selected') && clr_item.addClass('selected');
|
!clr_item.hasClass('selected') && clr_item.addClass('selected');
|
||||||
this.isAutoColor = true;
|
this.isAutoColor = true;
|
||||||
|
this.btnColor.menu.items[0].setChecked(false, true);
|
||||||
if (this._changedProps) {
|
if (this._changedProps) {
|
||||||
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
|
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
|
||||||
var color = new Asc.asc_CColor();
|
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) {
|
onColorsSelect: function(picker, color) {
|
||||||
this.btnColor.setColor(color);
|
this.btnColor.setColor(color);
|
||||||
if (this._changedProps) {
|
if (this._changedProps) {
|
||||||
|
@ -359,6 +384,7 @@ define([
|
||||||
this._changedProps.get_TextPr().put_Color(Common.Utils.ThemeColor.getRgbColor(color));
|
this._changedProps.get_TextPr().put_Color(Common.Utils.ThemeColor.getRgbColor(color));
|
||||||
}
|
}
|
||||||
this.isAutoColor = false;
|
this.isAutoColor = false;
|
||||||
|
this.btnColor.menu.items[0].setChecked(false, true);
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this.props);
|
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this.props);
|
||||||
}
|
}
|
||||||
|
@ -471,6 +497,7 @@ define([
|
||||||
this.bulletProps.font = textPr.get_FontFamily();
|
this.bulletProps.font = textPr.get_FontFamily();
|
||||||
|
|
||||||
var color = textPr.get_Color();
|
var color = textPr.get_Color();
|
||||||
|
this.btnColor.menu.items[0].setChecked(color===undefined, true);
|
||||||
if (color && !color.get_auto()) {
|
if (color && !color.get_auto()) {
|
||||||
if ( typeof(color) == 'object' ) {
|
if ( typeof(color) == 'object' ) {
|
||||||
var isselected = false;
|
var isselected = false;
|
||||||
|
@ -492,8 +519,9 @@ define([
|
||||||
!clr_item.hasClass('selected') && clr_item.addClass('selected');
|
!clr_item.hasClass('selected') && clr_item.addClass('selected');
|
||||||
color = '000000';
|
color = '000000';
|
||||||
this.isAutoColor = true;
|
this.isAutoColor = true;
|
||||||
} else
|
} else {
|
||||||
color = 'ffffff';
|
color = 'ffffff';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.btnColor.setColor(color);
|
this.btnColor.setColor(color);
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#id-toolbar-menu-auto-fontcolor > a.selected,
|
#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.selected,
|
||||||
#control-settings-system-color > a:hover {
|
#control-settings-system-color > a:hover {
|
||||||
span {
|
span {
|
||||||
|
|
Loading…
Reference in a new issue