[DE] Disable adding comment to the text in shape for customization->compatibleFeatures parameter

This commit is contained in:
Julia Radzhabova 2019-11-01 11:36:32 +03:00
parent 974c512765
commit fc4afa4a3a
2 changed files with 17 additions and 3 deletions

View file

@ -653,7 +653,8 @@ define([
var i = -1, type,
paragraph_locked = false,
header_locked = false,
image_locked = false;
image_locked = false,
in_image = false;
while (++i < selectedObjects.length) {
type = selectedObjects[i].get_ObjectType();
@ -663,11 +664,15 @@ define([
} else if (type === Asc.c_oAscTypeSelectElement.Header) {
header_locked = selectedObjects[i].get_ObjectValue().get_Locked();
} else if (type === Asc.c_oAscTypeSelectElement.Image) {
in_image = true;
image_locked = selectedObjects[i].get_ObjectValue().get_Locked();
}
}
var need_disable = !this.api.can_AddQuotedComment() || paragraph_locked || header_locked || image_locked;
if (this.mode.compatibleFeatures) {
need_disable = need_disable || in_image;
}
if ( this.btnsComment && this.btnsComment.length > 0 )
this.btnsComment.setDisabled(need_disable);
},
@ -829,6 +834,9 @@ define([
toolbar.listStylesAdditionalMenuItem.setDisabled(frame_pr===undefined);
need_disable = !this.api.can_AddQuotedComment() || paragraph_locked || header_locked || image_locked;
if (this.mode.compatibleFeatures) {
need_disable = need_disable || in_image;
}
if ( this.btnsComment && this.btnsComment.length > 0 )
this.btnsComment.setDisabled(need_disable);

View file

@ -1995,10 +1995,13 @@ define([
this.viewModeMenu = new Common.UI.Menu({
initMenu: function (value) {
var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties())),
isInShape = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ShapeProperties())),
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;
if (me.mode.compatibleFeatures)
canComment = canComment && !isInShape;
menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled);
menuViewUndo.setDisabled(!me.api.asc_getCanUndo() && !me._isDisabled);
@ -3625,8 +3628,11 @@ define([
text = me.api.can_AddHyperlink();
}
/** coauthoring begin **/
menuCommentSeparatorPara.setVisible(!isInChart && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments);
menuAddCommentPara.setVisible(!isInChart && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments);
var isVisible = !isInChart && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments;
if (me.mode.compatibleFeatures)
isVisible = isVisible && !isInShape;
menuCommentSeparatorPara.setVisible(isVisible);
menuAddCommentPara.setVisible(isVisible);
menuAddCommentPara.setDisabled(value.paraProps && value.paraProps.locked === true);
/** coauthoring end **/