Merge pull request #2024 from ONLYOFFICE/fix/bug-lock-comments

Fix/bug lock comments
This commit is contained in:
Julia Radzhabova 2022-10-24 21:21:44 +03:00 committed by GitHub
commit 36e40891dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2879,6 +2879,12 @@ define([
toolbar.lockToolbar(Common.enumLock['Objects'], !!this._state.wsProps['Objects']);
toolbar.lockToolbar(Common.enumLock['FormatCells'], !!this._state.wsProps['FormatCells']);
// info.asc_getComments()===null - has comment, but no permissions to view it
toolbar.lockToolbar(Common.enumLock.commentLock,
(selectionType == Asc.c_oAscSelectionType.RangeCells) && (!info.asc_getComments() || info.asc_getComments().length>0 || info.asc_getLocked())
|| selectionType != Asc.c_oAscSelectionType.RangeCells,
{ array: this.btnsComment });
if (editOptionsDisabled) return;
/* read font params */
@ -3234,10 +3240,6 @@ define([
}
toolbar.lockToolbar(Common.enumLock.itemsDisabled, !enabled, {array: [toolbar.btnDeleteCell]});
// info.asc_getComments()===null - has comment, but no permissions to view it
toolbar.lockToolbar(Common.enumLock.commentLock, (selectionType == Asc.c_oAscSelectionType.RangeCells) && (!info.asc_getComments() || info.asc_getComments().length>0 || info.asc_getLocked()) ||
this.toolbar.mode.compatibleFeatures && (selectionType != Asc.c_oAscSelectionType.RangeCells),
{ array: this.btnsComment });
toolbar.lockToolbar(Common.enumLock.headerLock, info.asc_getLockedHeaderFooter(), {array: this.toolbar.btnsEditHeader});
},
@ -3246,9 +3248,10 @@ define([
if (!this.appConfig.isRestrictedEdit) return;
var selectionType = info.asc_getSelectionType();
this.toolbar.lockToolbar(Common.enumLock.commentLock, (selectionType == Asc.c_oAscSelectionType.RangeCells) && (!info.asc_getComments() || info.asc_getComments().length>0 || info.asc_getLocked()) ||
this.appConfig && this.appConfig.compatibleFeatures && (selectionType != Asc.c_oAscSelectionType.RangeCells),
{ array: this.btnsComment });
this.toolbar.lockToolbar(Common.enumLock.commentLock,
(selectionType == Asc.c_oAscSelectionType.RangeCells) && (!info.asc_getComments() || info.asc_getComments().length>0 || info.asc_getLocked())
|| selectionType != Asc.c_oAscSelectionType.RangeCells,
{ array: this.btnsComment });
this.toolbar.lockToolbar(Common.enumLock['Objects'], !!this._state.wsProps['Objects'], { array: this.btnsComment });
},