[SSE] For Bug 51484
This commit is contained in:
parent
dc3c7711c4
commit
fb5612e265
|
@ -680,10 +680,12 @@ define([
|
|||
cellinfo = this.api.asc_getCellInfo();
|
||||
if (controller) {
|
||||
var comments = cellinfo.asc_getComments();
|
||||
if (comments.length) {
|
||||
controller.onEditComments(comments);
|
||||
} else if (this.permissions.canCoAuthoring) {
|
||||
controller.addDummyComment();
|
||||
if (comments) {
|
||||
if (comments.length) {
|
||||
controller.onEditComments(comments);
|
||||
} else if (this.permissions.canCoAuthoring) {
|
||||
controller.addDummyComment();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1981,9 +1983,9 @@ define([
|
|||
documentHolder.pmiFreezePanes.setCaption(this.api.asc_getSheetViewSettings().asc_getIsFreezePane() ? documentHolder.textUnFreezePanes : documentHolder.textFreezePanes);
|
||||
|
||||
/** coauthoring begin **/
|
||||
var count = cellinfo.asc_getComments().length;
|
||||
documentHolder.ssMenu.items[19].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && count < 1);
|
||||
documentHolder.pmiAddComment.setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && count < 1);
|
||||
var celcomments = cellinfo.asc_getComments(); // celcomments===null - has comment, but no permissions to view it
|
||||
documentHolder.ssMenu.items[19].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && celcomments && (celcomments.length < 1));
|
||||
documentHolder.pmiAddComment.setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && celcomments && (celcomments.length < 1));
|
||||
/** coauthoring end **/
|
||||
documentHolder.pmiCellMenuSeparator.setVisible(iscellmenu && !iscelledit || isrowmenu || iscolmenu || isallmenu);
|
||||
documentHolder.pmiEntireHide.isrowmenu = isrowmenu;
|
||||
|
@ -2091,7 +2093,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 && cellinfo.asc_getComments().length < 1;
|
||||
canComment = iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && !this._isDisabled && cellinfo.asc_getComments() && 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);
|
||||
|
|
|
@ -2843,7 +2843,8 @@ define([
|
|||
toolbar.btnDeleteCell.menu.items[1].setDisabled(this._state.controlsdisabled.cells_down);
|
||||
}
|
||||
|
||||
toolbar.lockToolbar(SSE.enumLock.commentLock, (selectionType == Asc.c_oAscSelectionType.RangeCells) && (info.asc_getComments().length>0 || info.asc_getLocked()) ||
|
||||
// info.asc_getComments()===null - has comment, but no permissions to view it
|
||||
toolbar.lockToolbar(SSE.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 });
|
||||
|
||||
|
@ -2852,7 +2853,7 @@ define([
|
|||
|
||||
onApiSelectionChangedRestricted: function(info) {
|
||||
var selectionType = info.asc_getSelectionType();
|
||||
this.toolbar.lockToolbar(SSE.enumLock.commentLock, (selectionType == Asc.c_oAscSelectionType.RangeCells) && (info.asc_getComments().length>0 || info.asc_getLocked()) ||
|
||||
this.toolbar.lockToolbar(SSE.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 });
|
||||
},
|
||||
|
|
|
@ -187,7 +187,7 @@ class ContextMenu extends ContextMenuController {
|
|||
|
||||
let iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu;
|
||||
const seltype = cellinfo.asc_getSelectionType();
|
||||
const isComments = cellinfo.asc_getComments().length > 0; //prohibit adding multiple comments in one cell;
|
||||
const hasComments = cellinfo.asc_getComments(); //prohibit adding multiple comments in one cell;
|
||||
|
||||
switch (seltype) {
|
||||
case Asc.c_oAscSelectionType.RangeCells: iscellmenu = true; break;
|
||||
|
@ -212,14 +212,14 @@ class ContextMenu extends ContextMenuController {
|
|||
event: 'openlink'
|
||||
});
|
||||
}
|
||||
if (canViewComments && isComments) {
|
||||
if (canViewComments && hasComments && hasComments.length>0) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
if (iscellmenu && !api.isCellEdited && canCoAuthoring && canComments && !isComments) {
|
||||
if (iscellmenu && !api.isCellEdited && canCoAuthoring && canComments && hasComments && hasComments.length<1) {
|
||||
itemsText.push({
|
||||
caption: _t.menuAddComment,
|
||||
event: 'addcomment'
|
||||
|
|
|
@ -22,7 +22,7 @@ class AddOtherController extends Component {
|
|||
const cellinfo = Common.EditorApi.get().asc_getCellInfo();
|
||||
const iscelllocked = cellinfo.asc_getLocked();
|
||||
const seltype = cellinfo.asc_getSelectionType();
|
||||
const isComments = cellinfo.asc_getComments().length > 0;
|
||||
const isComments = !cellinfo.asc_getComments() || cellinfo.asc_getComments().length > 0;
|
||||
return (!(seltype === Asc.c_oAscSelectionType.RangeCells && !iscelllocked) || isComments);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue