[SSE] Fix Bug 46126

This commit is contained in:
Julia Radzhabova 2020-08-13 15:03:53 +03:00
parent e67ef8b98c
commit 043d1c231b

View file

@ -1560,40 +1560,54 @@ define([
}, },
'command+shift+=,ctrl+shift+=': function(e) { 'command+shift+=,ctrl+shift+=': function(e) {
if (me.editMode && !me.toolbar.btnAddCell.isDisabled()) { if (me.editMode && !me.toolbar.btnAddCell.isDisabled()) {
var items = me.toolbar.btnAddCell.menu.items, var cellinfo = me.api.asc_getCellInfo(),
arr = []; selectionType = cellinfo.asc_getSelectionType();
for (var i=0; i<4; i++) if (selectionType === Asc.c_oAscSelectionType.RangeRow || selectionType === Asc.c_oAscSelectionType.RangeCol) {
arr.push({caption: items[i].caption, value: items[i].value, disabled: items[i].isDisabled()}); me.api.asc_insertCells(selectionType === Asc.c_oAscSelectionType.RangeRow ? Asc.c_oAscInsertOptions.InsertRows :Asc.c_oAscInsertOptions.InsertColumns );
(new SSE.Views.CellsAddDialog({ Common.NotificationCenter.trigger('edit:complete', me.toolbar);
title: me.txtInsertCells, } else {
items: arr, var items = me.toolbar.btnAddCell.menu.items,
handler: function (dlg, result) { arr = [];
if (result=='ok') { for (var i=0; i<4; i++)
me.api.asc_insertCells(dlg.getSettings()); arr.push({caption: items[i].caption, value: items[i].value, disabled: items[i].isDisabled()});
(new SSE.Views.CellsAddDialog({
title: me.txtInsertCells,
items: arr,
handler: function (dlg, result) {
if (result=='ok') {
me.api.asc_insertCells(dlg.getSettings());
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar); })).show();
} }
})).show();
} }
return false; return false;
}, },
'command+shift+-,ctrl+shift+-': function(e) { 'command+shift+-,ctrl+shift+-': function(e) {
if (me.editMode && !me.toolbar.btnDeleteCell.isDisabled()) { if (me.editMode && !me.toolbar.btnDeleteCell.isDisabled()) {
var items = me.toolbar.btnDeleteCell.menu.items, var cellinfo = me.api.asc_getCellInfo(),
arr = []; selectionType = cellinfo.asc_getSelectionType();
for (var i=0; i<4; i++) if (selectionType === Asc.c_oAscSelectionType.RangeRow || selectionType === Asc.c_oAscSelectionType.RangeCol) {
arr.push({caption: items[i].caption, value: items[i].value, disabled: items[i].isDisabled()}); me.api.asc_deleteCells(selectionType === Asc.c_oAscSelectionType.RangeRow ? Asc.c_oAscDeleteOptions.DeleteRows :Asc.c_oAscDeleteOptions.DeleteColumns );
(new SSE.Views.CellsAddDialog({ Common.NotificationCenter.trigger('edit:complete', me.toolbar);
title: me.txtDeleteCells, } else {
items: arr, var items = me.toolbar.btnDeleteCell.menu.items,
handler: function (dlg, result) { arr = [];
if (result=='ok') { for (var i=0; i<4; i++)
me.api.asc_deleteCells(dlg.getSettings()); arr.push({caption: items[i].caption, value: items[i].value, disabled: items[i].isDisabled()});
(new SSE.Views.CellsAddDialog({
title: me.txtDeleteCells,
items: arr,
handler: function (dlg, result) {
if (result=='ok') {
me.api.asc_deleteCells(dlg.getSettings());
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar); })).show();
} }
})).show();
} }
return false; return false;