[DE] Add numbering settings to table context menu

This commit is contained in:
Julia Radzhabova 2018-07-20 12:55:03 +03:00
parent ec34508a98
commit 52e812fcb4
2 changed files with 41 additions and 2 deletions

View file

@ -2781,6 +2781,30 @@ define([
}) })
}); });
var menuTableStartNewList = new Common.UI.MenuItem({
caption: me.textStartNewList
}).on('click', _.bind(me.onStartNumbering, me, 1));
var menuTableStartNumberingFrom = new Common.UI.MenuItem({
caption: me.textStartNumberingFrom
}).on('click', _.bind(me.onStartNumbering, me, 'advanced'));
var menuTableContinueNumbering = new Common.UI.MenuItem({
caption: me.textContinueNumbering
}).on('click', _.bind(me.onContinueNumbering, me));
var menuNumberingTable = new Common.UI.MenuItem({
caption : me.bulletsText,
menu : new Common.UI.Menu({
menuAlign: 'tl-tr',
items : [
menuTableStartNewList,
menuTableStartNumberingFrom,
menuTableContinueNumbering
]
})
});
this.tableMenu = new Common.UI.Menu({ this.tableMenu = new Common.UI.Menu({
initMenu: function(value){ initMenu: function(value){
// table properties // table properties
@ -2824,6 +2848,18 @@ define([
menuTableCut.setDisabled(disabled || !cancopy); menuTableCut.setDisabled(disabled || !cancopy);
menuTablePaste.setDisabled(disabled); menuTablePaste.setDisabled(disabled);
// bullets & numbering
var listId = me.api.asc_GetCurrentNumberingId(),
in_list = (listId !== null);
menuNumberingTable.setVisible(in_list);
if (in_list) {
var format = me.api.asc_GetNumberingPr(listId).get_Lvl(me.api.asc_GetCurrentNumberingLvl()).get_Format();
menuTableStartNumberingFrom.setVisible(format != Asc.c_oAscNumberingFormat.Bullet);
menuTableStartNumberingFrom.value = format;
menuTableStartNewList.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textSeparateList : me.textStartNewList);
menuTableContinueNumbering.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textJoinList : me.textContinueNumbering);
}
// hyperlink properties // hyperlink properties
var text = null; var text = null;
if (me.api) { if (me.api) {
@ -2831,7 +2867,7 @@ define([
} }
menuAddHyperlinkTable.setVisible(value.hyperProps===undefined && text!==false); menuAddHyperlinkTable.setVisible(value.hyperProps===undefined && text!==false);
menuHyperlinkTable.setVisible(value.hyperProps!==undefined); menuHyperlinkTable.setVisible(value.hyperProps!==undefined);
menuHyperlinkSeparator.setVisible(menuAddHyperlinkTable.isVisible() || menuHyperlinkTable.isVisible()); menuHyperlinkSeparator.setVisible(menuAddHyperlinkTable.isVisible() || menuHyperlinkTable.isVisible() || menuNumberingTable.isVisible());
menuEditHyperlinkTable.hyperProps = value.hyperProps; menuEditHyperlinkTable.hyperProps = value.hyperProps;
menuRemoveHyperlinkTable.hyperProps = value.hyperProps; menuRemoveHyperlinkTable.hyperProps = value.hyperProps;
@ -3006,6 +3042,7 @@ define([
/** coauthoring begin **/ /** coauthoring begin **/
menuAddCommentTable, menuAddCommentTable,
/** coauthoring end **/ /** coauthoring end **/
menuNumberingTable,
menuAddHyperlinkTable, menuAddHyperlinkTable,
menuHyperlinkTable, menuHyperlinkTable,
menuHyperlinkSeparator, menuHyperlinkSeparator,
@ -3840,7 +3877,8 @@ define([
textContinueNumbering: 'Continue numbering', textContinueNumbering: 'Continue numbering',
textSeparateList: 'Separate list', textSeparateList: 'Separate list',
textJoinList: 'Join to previous list', textJoinList: 'Join to previous list',
textNumberingValue: 'Numbering Value' textNumberingValue: 'Numbering Value',
bulletsText: 'Bullets and Numbering'
}, DE.Views.DocumentHolder || {})); }, DE.Views.DocumentHolder || {}));
}); });

View file

@ -1049,6 +1049,7 @@
"DE.Views.DocumentHolder.textSeparateList": "Separate list", "DE.Views.DocumentHolder.textSeparateList": "Separate list",
"DE.Views.DocumentHolder.textJoinList": "Join to previous list", "DE.Views.DocumentHolder.textJoinList": "Join to previous list",
"DE.Views.DocumentHolder.textNumberingValue": "Numbering Value", "DE.Views.DocumentHolder.textNumberingValue": "Numbering Value",
"DE.Views.DocumentHolder.bulletsText": "Bullets and Numbering",
"DE.Views.DropcapSettingsAdvanced.cancelButtonText": "Cancel", "DE.Views.DropcapSettingsAdvanced.cancelButtonText": "Cancel",
"DE.Views.DropcapSettingsAdvanced.okButtonText": "Ok", "DE.Views.DropcapSettingsAdvanced.okButtonText": "Ok",
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill", "DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",