[DE] Fix setting start value for list

This commit is contained in:
Julia Radzhabova 2018-07-20 15:15:28 +03:00
parent 68f097c5b2
commit 5636a4d266
2 changed files with 12 additions and 6 deletions

View file

@ -1904,7 +1904,7 @@ define([
var me = this; var me = this;
(new DE.Views.NumberingValueDialog({ (new DE.Views.NumberingValueDialog({
title: me.textNumberingValue, title: me.textNumberingValue,
props: {format: item.value}, props: item.value,
handler: function (result, value) { handler: function (result, value) {
if (result == 'ok') if (result == 'ok')
me.api.asc_RestartNumbering(value); me.api.asc_RestartNumbering(value);
@ -2853,9 +2853,12 @@ define([
in_list = (listId !== null); in_list = (listId !== null);
menuNumberingTable.setVisible(in_list); menuNumberingTable.setVisible(in_list);
if (in_list) { if (in_list) {
var format = me.api.asc_GetNumberingPr(listId).get_Lvl(me.api.asc_GetCurrentNumberingLvl()).get_Format(); var numLvl = me.api.asc_GetNumberingPr(listId).get_Lvl(me.api.asc_GetCurrentNumberingLvl()),
format = numLvl.get_Format(),
start = me.api.asc_GetCalculatedNumberingValue();
menuTableStartNewList.setVisible(numLvl.get_Start()!=start);
menuTableStartNumberingFrom.setVisible(format != Asc.c_oAscNumberingFormat.Bullet); menuTableStartNumberingFrom.setVisible(format != Asc.c_oAscNumberingFormat.Bullet);
menuTableStartNumberingFrom.value = format; menuTableStartNumberingFrom.value = {format: format, start: start};
menuTableStartNewList.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textSeparateList : me.textStartNewList); menuTableStartNewList.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textSeparateList : me.textStartNewList);
menuTableContinueNumbering.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textJoinList : me.textContinueNumbering); menuTableContinueNumbering.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textJoinList : me.textContinueNumbering);
} }
@ -3506,9 +3509,12 @@ define([
menuParaStartNumberingFrom.setVisible(in_list); menuParaStartNumberingFrom.setVisible(in_list);
menuParaContinueNumbering.setVisible(in_list); menuParaContinueNumbering.setVisible(in_list);
if (in_list) { if (in_list) {
var format = me.api.asc_GetNumberingPr(listId).get_Lvl(me.api.asc_GetCurrentNumberingLvl()).get_Format(); var numLvl = me.api.asc_GetNumberingPr(listId).get_Lvl(me.api.asc_GetCurrentNumberingLvl()),
format = numLvl.get_Format(),
start = me.api.asc_GetCalculatedNumberingValue();
menuParaStartNewList.setVisible(numLvl.get_Start()!=start);
menuParaStartNumberingFrom.setVisible(format != Asc.c_oAscNumberingFormat.Bullet); menuParaStartNumberingFrom.setVisible(format != Asc.c_oAscNumberingFormat.Bullet);
menuParaStartNumberingFrom.value = format; menuParaStartNumberingFrom.value = {format: format, start: start};
menuParaStartNewList.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textSeparateList : me.textStartNewList); menuParaStartNewList.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textSeparateList : me.textStartNewList);
menuParaContinueNumbering.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textJoinList : me.textContinueNumbering); menuParaContinueNumbering.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textJoinList : me.textContinueNumbering);
} }

View file

@ -102,7 +102,7 @@ define([
_setDefaults: function (props) { _setDefaults: function (props) {
if (props) { if (props) {
// this.spnStart.setValue(props.start); this.spnStart.setValue(props.start);
this.onFormatSelect(props.format); this.onFormatSelect(props.format);
} }
}, },