diff --git a/apps/spreadsheeteditor/main/app/controller/CellEditor.js b/apps/spreadsheeteditor/main/app/controller/CellEditor.js index cb92d6915..f7bbddcbb 100644 --- a/apps/spreadsheeteditor/main/app/controller/CellEditor.js +++ b/apps/spreadsheeteditor/main/app/controller/CellEditor.js @@ -133,6 +133,8 @@ define([ }, onApiEditCell: function(state) { + if (this.viewmode) return; // signed file + if (state == Asc.c_oAscCellEditorState.editStart){ this.api.isCellEdited = true; this.editor.cellNameDisabled(true); @@ -151,6 +153,8 @@ define([ }, onApiSelectionChanged: function(info) { + if (this.viewmode) return; // signed file + var seltype = info.asc_getSelectionType(), coauth_disable = (!this.mode.isEditMailMerge && !this.mode.isEditDiagram) ? (info.asc_getLocked() === true || info.asc_getLockedTable() === true || info.asc_getLockedPivotTable()===true) : false; @@ -241,6 +245,8 @@ define([ }, onInsertFunction: function() { + if (this.viewmode) return; // signed file + if ( this.mode.isEdit && !this.editor.$btnfunc['hasClass']('disabled')) { var controller = this.getApplication().getController('FormulaDialog'); if (controller) { @@ -314,6 +320,13 @@ define([ disableEditing: function(disabled) { this.editor.$btnfunc[!disabled?'removeClass':'addClass']('disabled'); this.editor.btnNamedRanges.setVisible(!disabled); + }, + + setPreviewMode: function(mode) { + if (this.viewmode === mode) return; + this.viewmode = mode; + this.editor.$btnfunc[!mode?'removeClass':'addClass']('disabled'); + this.editor.cellNameDisabled(mode); } }); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index 0a90ed4f9..f9b07b8b3 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -458,6 +458,7 @@ define([ var appConfig = me.viewport.mode; if ( !!appConfig && !appConfig.isEditDiagram && !appConfig.isEditMailMerge ) { if (index == this.api.asc_getActiveWorksheetIndex()) { + locked = locked || me.viewmode; me.header.mnuitemHideHeadings.setDisabled(locked); me.header.mnuitemHideGridlines.setDisabled(locked); me.header.mnuitemFreezePanes.setDisabled(locked); @@ -505,7 +506,10 @@ define([ }, disableEditing: function (disabled) { - this.header.btnOptions.menu.items[6].setDisabled(disabled); + this.viewmode = disabled; + this.header.mnuitemHideHeadings.setDisabled(disabled); + this.header.mnuitemHideGridlines.setDisabled(disabled); + this.header.mnuitemFreezePanes.setDisabled(disabled); }, textHideFBar: 'Hide Formula Bar', diff --git a/apps/spreadsheeteditor/main/app/view/SignatureSettings.js b/apps/spreadsheeteditor/main/app/view/SignatureSettings.js index b05e67694..a52299ad3 100644 --- a/apps/spreadsheeteditor/main/app/view/SignatureSettings.js +++ b/apps/spreadsheeteditor/main/app/view/SignatureSettings.js @@ -388,6 +388,8 @@ define([ SSE.getController('Statusbar').SetDisabled(disable); SSE.getController('Common.Controllers.ReviewChanges').SetDisabled(disable); SSE.getController('DocumentHolder').SetDisabled(disable, true); + SSE.getController('CellEditor').setPreviewMode(disable); + SSE.getController('Viewport').disableEditing(disable); // var leftMenu = SSE.getController('LeftMenu').leftMenu; // leftMenu.btnComments.setDisabled(disable); diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index 4fab2e202..2d83f985b 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -178,7 +178,7 @@ define([ //'tab:manual' : _.bind(this.onAddTabClick, this), 'tab:contextmenu' : _.bind(this.onTabMenu, this), 'tab:dblclick' : _.bind(function () { - if (me.editMode && (me.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.Chart) && + if (me.editMode && !(me.mode && me.mode.isDisconnected) && (me.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.Chart) && (me.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.FormatTable)&& (me.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.PrintTitles)) { me.fireEvent('sheet:changename'); @@ -502,7 +502,7 @@ define([ label : me.api.asc_getWorksheetName(i), // reorderable : !locked, cls : locked ? 'coauth-locked':'', - isLockTheDrag : locked, + isLockTheDrag : locked || me.mode.isDisconnected, iconCls : 'btn-sheet-view', iconTitle : name, iconVisible : name!==''