diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 4554ae76a..5f9c50779 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -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; } diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 6b779ee90..275aa3f6c 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -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 diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 9a6af6517..40d30b742 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -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) { diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 105471fd6..53a3fca17 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -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',