[DE] Fix color settings for list
This commit is contained in:
parent
19e8c27300
commit
8149092637
|
@ -130,6 +130,22 @@ define([
|
||||||
$window = this.getChild();
|
$window = this.getChild();
|
||||||
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||||
|
|
||||||
|
this.menuAddAlign = function(menuRoot, left, top) {
|
||||||
|
var self = this;
|
||||||
|
if (!$window.hasClass('notransform')) {
|
||||||
|
$window.addClass('notransform');
|
||||||
|
menuRoot.addClass('hidden');
|
||||||
|
setTimeout(function() {
|
||||||
|
menuRoot.removeClass('hidden');
|
||||||
|
menuRoot.css({left: left, top: top});
|
||||||
|
self.options.additionalAlign = null;
|
||||||
|
}, 300);
|
||||||
|
} else {
|
||||||
|
menuRoot.css({left: left, top: top});
|
||||||
|
self.options.additionalAlign = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
this.btnColor = new Common.UI.ColorButton({
|
this.btnColor = new Common.UI.ColorButton({
|
||||||
style: 'width:45px;',
|
style: 'width:45px;',
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
|
@ -141,11 +157,11 @@ define([
|
||||||
checkable: true,
|
checkable: true,
|
||||||
toggleGroup: 'list-settings-color'
|
toggleGroup: 'list-settings-color'
|
||||||
},
|
},
|
||||||
{caption: '--'},
|
|
||||||
{
|
{
|
||||||
id: 'id-dlg-bullet-auto-color',
|
id: 'id-dlg-bullet-auto-color',
|
||||||
caption: this.textAuto,
|
caption: this.textAuto,
|
||||||
template: _.template('<a tabindex="-1" type="menuitem"><span class="menu-item-icon" style="background-image: none; width: 12px; height: 12px; margin: 1px 7px 0 -7px; background-color: #000;"></span><%= caption %></a>')
|
checkable: true,
|
||||||
|
toggleGroup: 'list-settings-color'
|
||||||
},
|
},
|
||||||
{caption: '--'},
|
{caption: '--'},
|
||||||
{ template: _.template('<div id="id-dlg-bullet-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
|
{ template: _.template('<div id="id-dlg-bullet-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
|
||||||
|
@ -162,24 +178,8 @@ 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));
|
this.btnColor.menu.items[0].on('toggle', _.bind(this.onLikeTextColor, this));
|
||||||
$window.find('#id-dlg-bullet-text-color').on('click', _.bind(this.onLikeTextColor, this));
|
this.btnColor.menu.items[1].on('toggle', _.bind(this.onAutoColor, this));
|
||||||
|
|
||||||
this.menuAddAlign = function(menuRoot, left, top) {
|
|
||||||
var self = this;
|
|
||||||
if (!$window.hasClass('notransform')) {
|
|
||||||
$window.addClass('notransform');
|
|
||||||
menuRoot.addClass('hidden');
|
|
||||||
setTimeout(function() {
|
|
||||||
menuRoot.removeClass('hidden');
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}, 300);
|
|
||||||
} else {
|
|
||||||
menuRoot.css({left: left, top: top});
|
|
||||||
self.options.additionalAlign = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.btnEdit = new Common.UI.Button({
|
this.btnEdit = new Common.UI.Button({
|
||||||
el: $window.find('#id-dlg-bullet-font')
|
el: $window.find('#id-dlg-bullet-font')
|
||||||
|
@ -343,38 +343,35 @@ define([
|
||||||
picker.addNewColor((typeof(btn.color) == 'object') ? btn.color.color : btn.color);
|
picker.addNewColor((typeof(btn.color) == 'object') ? btn.color.color : btn.color);
|
||||||
},
|
},
|
||||||
|
|
||||||
onAutoColor: function(e) {
|
onAutoColor: function(item, state) {
|
||||||
var color = Common.Utils.ThemeColor.getHexColor(0, 0, 0);
|
if (!!state) {
|
||||||
this.btnColor.setColor(color);
|
var color = Common.Utils.ThemeColor.getHexColor(0, 0, 0);
|
||||||
this.colors.clearSelection();
|
this.btnColor.setColor(color);
|
||||||
var clr_item = this.btnColor.menu.$el.find('#id-dlg-bullet-auto-color > a');
|
this.colors.clearSelection();
|
||||||
!clr_item.hasClass('selected') && clr_item.addClass('selected');
|
if (this._changedProps) {
|
||||||
this.isAutoColor = true;
|
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
|
||||||
this.btnColor.menu.items[0].setChecked(false, true);
|
var color = new Asc.asc_CColor();
|
||||||
if (this._changedProps) {
|
color.put_auto(true);
|
||||||
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
|
this._changedProps.get_TextPr().put_Color(color);
|
||||||
var color = new Asc.asc_CColor();
|
}
|
||||||
color.put_auto(true);
|
if (this.api) {
|
||||||
this._changedProps.get_TextPr().put_Color(color);
|
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this.props);
|
||||||
}
|
}
|
||||||
if (this.api) {
|
|
||||||
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this.props);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onLikeTextColor: function(e) {
|
onLikeTextColor: function(item, state) {
|
||||||
var color = Common.Utils.ThemeColor.getHexColor(255, 255, 255);
|
if (!!state) {
|
||||||
this.btnColor.setColor(color);
|
var color = Common.Utils.ThemeColor.getHexColor(255, 255, 255);
|
||||||
this.colors.clearSelection();
|
this.btnColor.setColor(color);
|
||||||
var clr_item = this.btnColor.menu.$el.find('#id-dlg-bullet-auto-color > a');
|
this.colors.clearSelection();
|
||||||
clr_item.removeClass('selected');
|
if (this._changedProps) {
|
||||||
this.isAutoColor = false;
|
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
|
||||||
if (this._changedProps) {
|
this._changedProps.get_TextPr().put_Color(undefined);
|
||||||
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);
|
||||||
if (this.api) {
|
}
|
||||||
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this.props);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -384,8 +381,8 @@ define([
|
||||||
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
|
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
|
||||||
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.btnColor.menu.items[0].setChecked(false, true);
|
this.btnColor.menu.items[0].setChecked(false, true);
|
||||||
|
this.btnColor.menu.items[1].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);
|
||||||
}
|
}
|
||||||
|
@ -498,6 +495,7 @@ define([
|
||||||
|
|
||||||
var color = textPr.get_Color();
|
var color = textPr.get_Color();
|
||||||
this.btnColor.menu.items[0].setChecked(color===undefined, true);
|
this.btnColor.menu.items[0].setChecked(color===undefined, true);
|
||||||
|
this.btnColor.menu.items[1].setChecked(!!color && color.get_auto(), 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;
|
||||||
|
@ -514,14 +512,7 @@ define([
|
||||||
this.colors.select(color,true);
|
this.colors.select(color,true);
|
||||||
} else {
|
} else {
|
||||||
this.colors.clearSelection();
|
this.colors.clearSelection();
|
||||||
if (color && color.get_auto()) {
|
color = (color && color.get_auto()) ? '000000' : 'ffffff';
|
||||||
var clr_item = this.btnColor.menu.$el.find('#id-dlg-bullet-auto-color > a');
|
|
||||||
!clr_item.hasClass('selected') && clr_item.addClass('selected');
|
|
||||||
color = '000000';
|
|
||||||
this.isAutoColor = true;
|
|
||||||
} else {
|
|
||||||
color = 'ffffff';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.btnColor.setColor(color);
|
this.btnColor.setColor(color);
|
||||||
}
|
}
|
||||||
|
@ -546,7 +537,7 @@ define([
|
||||||
textLeft: 'Left',
|
textLeft: 'Left',
|
||||||
textCenter: 'Center',
|
textCenter: 'Center',
|
||||||
textRight: 'Right',
|
textRight: 'Right',
|
||||||
textAuto: 'Auto',
|
textAuto: 'Automatic',
|
||||||
textPreview: 'Preview',
|
textPreview: 'Preview',
|
||||||
txtType: 'Type',
|
txtType: 'Type',
|
||||||
txtLikeText: 'Like a text',
|
txtLikeText: 'Like a text',
|
||||||
|
|
|
@ -1701,7 +1701,7 @@
|
||||||
"DE.Views.ListSettingsDialog.textLeft": "Left",
|
"DE.Views.ListSettingsDialog.textLeft": "Left",
|
||||||
"DE.Views.ListSettingsDialog.textCenter": "Center",
|
"DE.Views.ListSettingsDialog.textCenter": "Center",
|
||||||
"DE.Views.ListSettingsDialog.textRight": "Right",
|
"DE.Views.ListSettingsDialog.textRight": "Right",
|
||||||
"DE.Views.ListSettingsDialog.textAuto": "Auto",
|
"DE.Views.ListSettingsDialog.textAuto": "Automatic",
|
||||||
"DE.Views.ListSettingsDialog.textPreview": "Preview",
|
"DE.Views.ListSettingsDialog.textPreview": "Preview",
|
||||||
"DE.Views.ListSettingsDialog.txtType": "Type",
|
"DE.Views.ListSettingsDialog.txtType": "Type",
|
||||||
"DE.Views.ListSettingsDialog.txtLikeText": "Like a text",
|
"DE.Views.ListSettingsDialog.txtLikeText": "Like a text",
|
||||||
|
|
Loading…
Reference in a new issue