Merge pull request #711 from ONLYOFFICE/fix/bugfix

[SSE] Bug 48708
This commit is contained in:
Julia Radzhabova 2021-02-16 14:52:15 +03:00 committed by GitHub
commit 0c23681b48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 3 deletions

View file

@ -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);
}
});
});

View file

@ -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',

View file

@ -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);

View file

@ -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!==''