[SSE] Fix visible area

This commit is contained in:
Julia Radzhabova 2022-06-01 14:11:02 +03:00
parent 9763753203
commit 65d2d1796a
4 changed files with 20 additions and 4 deletions

View file

@ -768,6 +768,7 @@ define([
if (this.mode.isEditDiagram || this.mode.isEditMailMerge || this.mode.isEditOle) {
menu_opened = $(document.body).find('.open > .dropdown-menu');
if (!this.api.isCellEdited && !menu_opened.length) {
this.mode.isEditOle && Common.NotificationCenter.trigger('oleedit:close');
Common.Gateway.internalMessage('shortcut', {key:'escape'});
return false;
}

View file

@ -2554,6 +2554,7 @@ define([
if (!Common.Utils.ModalWindow.isVisible()) {
this.isFrameClosed = true;
this.api.asc_closeCellEditor();
this.appOptions.isEditOle && Common.NotificationCenter.trigger('oleedit:close');
Common.UI.Menu.Manager.hideAll();
Common.Gateway.internalMessage('canClose', {mr:data.data.mr, answer: true});
} else

View file

@ -154,6 +154,7 @@ define([
Common.NotificationCenter.on('toolbar:collapse', _.bind(function () {
this.toolbar.collapse();
}, this));
Common.NotificationCenter.on('oleedit:close', _.bind(this.onOleEditClose, this));
this.editMode = true;
this._isAddingShape = false;
@ -4585,7 +4586,7 @@ define([
onVisibleAreaClose: function(btn) {
if (this.api)
this.api.asc_toggleVisibleAreaOleEditor(false);
this.api.asc_toggleChangeVisibleAreaOleEditor(false);
this.toolbar.lockToolbar(Common.enumLock.editVisibleArea, false);
this.toolbar.btnVisibleArea.setVisible(true);
this.toolbar.btnVisibleAreaClose.setVisible(false);
@ -4595,12 +4596,12 @@ define([
onVisibleAreaMenu: function(menu, item, e) {
if (this.api) {
if (item.value === 'edit') {
this.api.asc_toggleVisibleAreaOleEditor(true);
this.api.asc_toggleChangeVisibleAreaOleEditor(true);
this.toolbar.btnVisibleArea.setVisible(false);
this.toolbar.btnVisibleAreaClose.setVisible(true);
this.toolbar.lockToolbar(Common.enumLock.editVisibleArea, true);
} else { // show or hide
// this.api.asc_showVisibleArea(item.value === 'show');
this.api.asc_toggleShowVisibleAreaOleEditor(item.value === 'show');
this.toolbar.btnVisibleArea.menu.items[0].setVisible(item.value !== 'show');
this.toolbar.btnVisibleArea.menu.items[1].setVisible(item.value === 'show');
}
@ -4608,6 +4609,19 @@ define([
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
onOleEditClose: function() {
if (this.api) {
this.api.asc_toggleChangeVisibleAreaOleEditor(false);
this.toolbar.btnVisibleArea.setVisible(true);
this.toolbar.btnVisibleAreaClose.setVisible(false);
this.toolbar.lockToolbar(Common.enumLock.editVisibleArea, false);
this.api.asc_toggleShowVisibleAreaOleEditor(false);
this.toolbar.btnVisibleArea.menu.items[0].setVisible(true);
this.toolbar.btnVisibleArea.menu.items[1].setVisible(false);
}
},
onTextFormattingMenu: function(menu, item) {
if (this.api) {
switch (item.value) {

View file

@ -434,7 +434,7 @@ define([
id : 'id-toolbar-rtn-wrap',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-wrap',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selSlicer, _set.lostConnect, _set.coAuth, _set['FormatCells']],
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selSlicer, _set.lostConnect, _set.coAuth, _set['FormatCells'], _set.editVisibleArea],
enableToggle: true,
allowDepress: true,
dataHint : '1',