[DE] Change list settings

This commit is contained in:
Julia Radzhabova 2019-12-17 12:32:15 +03:00
parent 69edbf54dc
commit 88aa2e5ab7
2 changed files with 30 additions and 21 deletions

View file

@ -495,7 +495,10 @@ define([
switch(this._state.bullets.type) {
case 0:
this.toolbar.btnMarkers.toggle(true, true);
if (this._state.bullets.subtype!==undefined)
this.toolbar.mnuMarkersPicker.selectByIndex(this._state.bullets.subtype, true);
else
this.toolbar.mnuMarkersPicker.deselectAll(true);
break;
case 1:
var idx = 0;
@ -1315,16 +1318,6 @@ define([
onMarkerSettingsClick: function(type) {
var me = this;
// var selectedElements = me.api.getSelectedElements();
// if (selectedElements && _.isArray(selectedElements)) {
// for (var i = 0; i< selectedElements.length; i++) {
// if (Asc.c_oAscTypeSelectElement.Paragraph == selectedElements[i].get_ObjectType()) {
// props = selectedElements[i].get_ObjectValue();
// break;
// }
// }
// }
var listId = me.api.asc_GetCurrentNumberingId(),
level = me.api.asc_GetCurrentNumberingLvl(),
props = (listId !== null) ? me.api.asc_GetNumberingPr(listId).get_Lvl(level) : null;
@ -1337,7 +1330,7 @@ define([
handler: function(result, value) {
if (result == 'ok') {
if (me.api) {
// me.api.paraApply(value);
me.api.asc_ChangeNumberingLvl(listId, value, props.get_LvlNum());
}
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);

View file

@ -91,7 +91,7 @@ define([
'<tr>',
'<td colspan="2">',
'<label>' + this.textPreview + '</label>',
'<div id="page-margins-preview" style="margin-top: 2px; height: 120px; width: 100%; border: 1px solid #cfcfcf;"></div>',
'<div id="bulleted-list-preview" style="margin-top: 2px; height: 120px; width: 100%; border: 1px solid #cfcfcf;"></div>',
'</td>',
'</tr>',
'</table>',
@ -120,7 +120,7 @@ define([
{
id: 'id-dlg-bullet-auto-color',
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: #dcdcdc;"></span><%= caption %></a>')
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>')
},
{caption: '--'},
{ template: _.template('<div id="id-dlg-bullet-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>') },
@ -175,13 +175,13 @@ define([
if (this._changedProps)
this._changedProps.put_Align(record.value);
if (this.api) {
//this.api.SetDrawImagePreviewMargins('page-margins-preview', this.properties);
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this._changedProps);
}
}, this));
this.cmbSize = new Common.UI.ComboBox({
el : $window.find('#id-dlg-bullet-size'),
menuStyle : 'min-width: 100%;max-height: 310px;',
menuStyle : 'min-width: 100%;max-height: 183px;',
editable : false,
cls : 'input-group-nr',
data : [
@ -208,10 +208,10 @@ define([
this.cmbSize.on('selected', _.bind(function (combo, record) {
if (this._changedProps) {
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
this._changedProps.get_TextPr().put_FontSize(record.value);
this._changedProps.get_TextPr().put_FontSize((record.value>0) ? record.value : null);
}
if (this.api) {
//this.api.SetDrawImagePreviewMargins('page-margins-preview', this.properties);
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this._changedProps);
}
}, this));
@ -232,20 +232,33 @@ define([
},
onAutoColor: function(e) {
var color = Common.Utils.ThemeColor.getHexColor(220, 220, 220);
var color = Common.Utils.ThemeColor.getHexColor(0, 0, 0);
this.btnColor.setColor(color);
this.colors.clearSelection();
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;
if (this._changedProps) {
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
var color = new Asc.asc_CColor();
color.put_auto(true);
this._changedProps.get_TextPr().put_Color(color);
}
if (this.api) {
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this._changedProps);
}
},
onColorsSelect: function(picker, color) {
this.btnColor.setColor(color);
if (this._changedProps) {
// this._changedProps.asc_putBulletColor(Common.Utils.ThemeColor.getRgbColor(color));
if (!this._changedProps.get_TextPr()) this._changedProps.put_TextPr(new AscCommonWord.CTextPr());
this._changedProps.get_TextPr().put_Color(Common.Utils.ThemeColor.getRgbColor(color));
}
this.isAutoColor = false;
if (this.api) {
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this._changedProps);
}
},
onEditBullet: function() {
@ -278,6 +291,9 @@ define([
});
win.show();
win.on('symbol:dblclick', handler);
if (this.api) {
//this.api.SetDrawImagePreviewBullet('bulleted-list-preview', this._changedProps);
}
},
_handleInput: function(state) {
@ -337,7 +353,7 @@ define([
this.btnColor.setColor(color);
}
}
this._changedProps = new Asc.CAscNumberingLvl(this.level);
this._changedProps = props || new Asc.CAscNumberingLvl(this.level);
},
txtTitle: 'Define New Bullet',