From e8666840ff0f9fff294a89582686c122094904ca Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 12 Apr 2019 16:23:21 +0300 Subject: [PATCH] [SSE] Bug 40959 --- .../main/app/controller/DocumentHolder.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index ab2c528a1..28cecea7d 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -1707,14 +1707,14 @@ define([ documentHolder.pmiFreezePanes.setCaption(this.api.asc_getSheetViewSettings().asc_getIsFreezePane() ? documentHolder.textUnFreezePanes : documentHolder.textFreezePanes); /** coauthoring begin **/ - documentHolder.ssMenu.items[17].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments); - documentHolder.pmiAddComment.setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments); + var count = cellinfo.asc_getComments().length; + documentHolder.ssMenu.items[17].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && count < 1); + documentHolder.pmiAddComment.setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && count < 1); /** coauthoring end **/ documentHolder.pmiCellMenuSeparator.setVisible(iscellmenu && !iscelledit || isrowmenu || iscolmenu || isallmenu); documentHolder.pmiEntireHide.isrowmenu = isrowmenu; documentHolder.pmiEntireShow.isrowmenu = isrowmenu; - documentHolder.setMenuItemCommentCaptionMode(documentHolder.pmiAddComment, cellinfo.asc_getComments().length < 1, this.permissions.canEditComments); commentsController && commentsController.blockPopover(true); documentHolder.pmiClear.menu.items[0].setDisabled(!this.permissions.canModifyFilter); @@ -1809,7 +1809,7 @@ define([ var signProps = (signGuid) ? this.api.asc_getSignatureSetup(signGuid) : null, isInSign = !!signProps && this._canProtect, - canComment = iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && !this._isDisabled; + canComment = iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && !this._isDisabled && cellinfo.asc_getComments().length < 1; documentHolder.menuViewUndo.setVisible(this.permissions.canCoAuthoring && this.permissions.canComments && !this._isDisabled); documentHolder.menuViewUndo.setDisabled(!this.api.asc_getCanUndo() && !this._isDisabled); @@ -1830,7 +1830,6 @@ define([ } documentHolder.menuViewAddComment.setVisible(canComment); - documentHolder.setMenuItemCommentCaptionMode(documentHolder.menuViewAddComment, cellinfo.asc_getComments().length < 1, this.permissions.canEditComments); commentsController && commentsController.blockPopover(true); documentHolder.menuViewAddComment.setDisabled(isCellLocked || isTableLocked); if (showMenu) this.showPopupMenu(documentHolder.viewModeMenu, {}, event);