[DE] Bug 42936: fix lock comments in commenting mode, add lock in context menu
This commit is contained in:
parent
5847226bba
commit
f8de67a58f
|
@ -663,12 +663,14 @@ define([
|
|||
paragraph_locked = false,
|
||||
header_locked = false,
|
||||
image_locked = false,
|
||||
in_image = false;
|
||||
in_image = false,
|
||||
frame_pr = undefined;
|
||||
|
||||
while (++i < selectedObjects.length) {
|
||||
type = selectedObjects[i].get_ObjectType();
|
||||
|
||||
if (type === Asc.c_oAscTypeSelectElement.Paragraph) {
|
||||
frame_pr = selectedObjects[i].get_ObjectValue();
|
||||
paragraph_locked = selectedObjects[i].get_ObjectValue().get_Locked();
|
||||
} else if (type === Asc.c_oAscTypeSelectElement.Header) {
|
||||
header_locked = selectedObjects[i].get_ObjectValue().get_Locked();
|
||||
|
@ -678,7 +680,12 @@ define([
|
|||
}
|
||||
}
|
||||
|
||||
var need_disable = !this.api.can_AddQuotedComment() || paragraph_locked || header_locked || image_locked;
|
||||
var rich_del_lock = (frame_pr) ? !frame_pr.can_DeleteBlockContentControl() : false,
|
||||
rich_edit_lock = (frame_pr) ? !frame_pr.can_EditBlockContentControl() : false,
|
||||
plain_del_lock = (frame_pr) ? !frame_pr.can_DeleteInlineContentControl() : false,
|
||||
plain_edit_lock = (frame_pr) ? !frame_pr.can_EditInlineContentControl() : false;
|
||||
|
||||
var need_disable = !this.api.can_AddQuotedComment() || paragraph_locked || header_locked || image_locked || rich_del_lock || rich_edit_lock || plain_del_lock || plain_edit_lock;
|
||||
if (this.mode.compatibleFeatures) {
|
||||
need_disable = need_disable || in_image;
|
||||
}
|
||||
|
|
|
@ -2008,7 +2008,10 @@ define([
|
|||
signGuid = (value.imgProps && value.imgProps.value && me.mode.isSignatureSupport) ? value.imgProps.value.asc_getSignatureId() : undefined,
|
||||
signProps = (signGuid) ? me.api.asc_getSignatureSetup(signGuid) : null,
|
||||
isInSign = !!signProps && me._canProtect,
|
||||
canComment = !isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled;
|
||||
control_lock = (value.paraProps) ? (!value.paraProps.value.can_DeleteBlockContentControl() || !value.paraProps.value.can_EditBlockContentControl() ||
|
||||
!value.paraProps.value.can_DeleteInlineContentControl() || !value.paraProps.value.can_EditInlineContentControl()) : false,
|
||||
canComment = !isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled && !control_lock;
|
||||
|
||||
if (me.mode.compatibleFeatures)
|
||||
canComment = canComment && !isInShape;
|
||||
|
||||
|
@ -3079,7 +3082,9 @@ define([
|
|||
}
|
||||
/** coauthoring begin **/
|
||||
// comments
|
||||
menuAddCommentTable.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments);
|
||||
var control_lock = (value.paraProps) ? (!value.paraProps.value.can_DeleteBlockContentControl() || !value.paraProps.value.can_EditBlockContentControl() ||
|
||||
!value.paraProps.value.can_DeleteInlineContentControl() || !value.paraProps.value.can_EditInlineContentControl()) : false;
|
||||
menuAddCommentTable.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments && !control_lock);
|
||||
menuAddCommentTable.setDisabled(value.paraProps!==undefined && value.paraProps.locked===true);
|
||||
/** coauthoring end **/
|
||||
|
||||
|
@ -3655,7 +3660,9 @@ define([
|
|||
text = me.api.can_AddHyperlink();
|
||||
}
|
||||
/** coauthoring begin **/
|
||||
var isVisible = !isInChart && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments;
|
||||
var control_lock = (value.paraProps) ? (!value.paraProps.value.can_DeleteBlockContentControl() || !value.paraProps.value.can_EditBlockContentControl() ||
|
||||
!value.paraProps.value.can_DeleteInlineContentControl() || !value.paraProps.value.can_EditInlineContentControl()) : false;
|
||||
var isVisible = !isInChart && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments && !control_lock;
|
||||
if (me.mode.compatibleFeatures)
|
||||
isVisible = isVisible && !isInShape;
|
||||
menuCommentSeparatorPara.setVisible(isVisible);
|
||||
|
|
Loading…
Reference in a new issue