From 119356217a54d33ca6c7e1efe80b80a7f72a286f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 14 Oct 2020 16:48:26 +0300 Subject: [PATCH] [SSE] Disable close view button for default sheet mode --- apps/spreadsheeteditor/main/app/controller/ViewTab.js | 3 +++ apps/spreadsheeteditor/main/app/view/Toolbar.js | 3 ++- apps/spreadsheeteditor/main/app/view/ViewTab.js | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 8a38b83bb..b4c07e636 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -115,6 +115,9 @@ define([ onSelectionChanged: function(info) { if (!this.toolbar.editMode || !this.view) return; + + Common.Utils.lockControls(SSE.enumLock.sheetView, this.api.asc_getActiveNamedSheetView && !this.api.asc_getActiveNamedSheetView(this.api.asc_getActiveWorksheetIndex()), + {array: [this.view.btnCloseView]}); }, onFreeze: function(state) { diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index fa5315672..7fc5d01f7 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -97,7 +97,8 @@ define([ selSlicer: 'sel-slicer', cantSort: 'cant-sort', pivotLock: 'pivot-lock', - tableHasSlicer: 'table-has-slicer' + tableHasSlicer: 'table-has-slicer', + sheetView: 'sheet-view' }; SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({ diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index 0420a1495..e22dcfe16 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -114,7 +114,7 @@ define([ cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-sheet-view-close', caption : this.textClose, - lock : [_set.coAuth, _set.lostConnect] + lock : [_set.sheetView, _set.coAuth, _set.lostConnect] }); this.lockedControls.push(this.btnCloseView); Common.Utils.injectComponent($host.find('#slot-closeview'), this.btnCloseView);