[PE SSE mobile] Correct context menu
This commit is contained in:
parent
743cd8a42a
commit
48b682c54c
|
@ -196,7 +196,7 @@ class ContextMenu extends ContextMenuController {
|
|||
initMenuItems() {
|
||||
if ( !Common.EditorApi ) return [];
|
||||
|
||||
const { isEdit } = this.props;
|
||||
const { isEdit, isDisconnected } = this.props;
|
||||
|
||||
if (isEdit && EditorUIController.ContextMenu) {
|
||||
return EditorUIController.ContextMenu.mapMenuItems(this);
|
||||
|
@ -253,18 +253,20 @@ class ContextMenu extends ContextMenuController {
|
|||
icon: 'icon-copy'
|
||||
});
|
||||
}
|
||||
if (canViewComments && this.isComments && !isEdit) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
if (!isChart && api.can_AddQuotedComment() !== false && canCoAuthoring && canComments && !locked) {
|
||||
itemsText.push({
|
||||
caption: _t.menuAddComment,
|
||||
event: 'addcomment'
|
||||
});
|
||||
if(!isDisconnected) {
|
||||
if (canViewComments && this.isComments && !isEdit) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
if (!isChart && api.can_AddQuotedComment() !== false && canCoAuthoring && canComments && !locked) {
|
||||
itemsText.push({
|
||||
caption: _t.menuAddComment,
|
||||
event: 'addcomment'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (isLink) {
|
||||
|
|
|
@ -209,7 +209,7 @@ class ContextMenu extends ContextMenuController {
|
|||
const { t } = this.props;
|
||||
const _t = t("ContextMenu", { returnObjects: true });
|
||||
|
||||
const { isEdit } = this.props;
|
||||
const { isEdit, isDisconnected } = this.props;
|
||||
|
||||
if (isEdit && EditorUIController.ContextMenu) {
|
||||
return EditorUIController.ContextMenu.mapMenuItems(this);
|
||||
|
@ -249,18 +249,20 @@ class ContextMenu extends ContextMenuController {
|
|||
event: 'openlink'
|
||||
});
|
||||
}
|
||||
if (canViewComments && hasComments && hasComments.length>0) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
if (iscellmenu && !api.isCellEdited && canCoAuthoring && canComments && hasComments && hasComments.length<1) {
|
||||
itemsText.push({
|
||||
caption: _t.menuAddComment,
|
||||
event: 'addcomment'
|
||||
});
|
||||
if(!isDisconnected) {
|
||||
if (canViewComments && hasComments && hasComments.length>0) {
|
||||
itemsText.push({
|
||||
caption: _t.menuViewComment,
|
||||
event: 'viewcomment'
|
||||
});
|
||||
}
|
||||
|
||||
if (iscellmenu && !api.isCellEdited && canCoAuthoring && canComments && hasComments && hasComments.length<1) {
|
||||
itemsText.push({
|
||||
caption: _t.menuAddComment,
|
||||
event: 'addcomment'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return itemsIcon.concat(itemsText);
|
||||
|
|
|
@ -426,11 +426,16 @@ class MainController extends Component {
|
|||
this.api.asc_registerCallback('asc_onActiveSheetChanged', this.onChangeProtectSheet.bind(this));
|
||||
|
||||
this.api.asc_registerCallback('asc_onRenameCellTextEnd', this.onRenameText.bind(this));
|
||||
|
||||
this.api.asc_registerCallback('asc_onEntriesListMenu', this.onEntriesListMenu.bind(this, false));
|
||||
this.api.asc_registerCallback('asc_onValidationListMenu', this.onEntriesListMenu.bind(this, true));
|
||||
}
|
||||
|
||||
onEntriesListMenu(validation, textArr, addArr) {
|
||||
const storeAppOptions = this.props.storeAppOptions;
|
||||
|
||||
if (!storeAppOptions.isEdit && !storeAppOptions.isRestrictedEdit || this.props.users.isDisconnected) return;
|
||||
|
||||
const { t } = this.props;
|
||||
const boxSdk = $$('#editor_sdk');
|
||||
|
||||
|
|
Loading…
Reference in a new issue