From 3e508e7de3304427a4e6d1b555901a6dee82af14 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Thu, 4 Aug 2022 01:20:46 +0300 Subject: [PATCH] [DE mobile] Fix Bug 51540 --- .../mobile/src/controller/ContextMenu.jsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx index 52b4f2dfb..a6fa02707 100644 --- a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx @@ -19,7 +19,8 @@ import EditorUIController from '../lib/patch'; users: stores.users, isDisconnected: stores.users.isDisconnected, displayMode: stores.storeReview.displayMode, - dataDoc: stores.storeDocumentInfo.dataDoc + dataDoc: stores.storeDocumentInfo.dataDoc, + objects: stores.storeFocusObjects.settings })) class ContextMenu extends ContextMenuController { constructor(props) { @@ -32,6 +33,7 @@ class ContextMenu extends ContextMenuController { this.getUserName = this.getUserName.bind(this); this.isUserVisible = this.isUserVisible.bind(this); this.ShowModal = this.ShowModal.bind(this); + this.checkShapeSelection = this.checkShapeSelection.bind(this); } static closeContextMenu() { @@ -55,6 +57,7 @@ class ContextMenu extends ContextMenuController { api.asc_unregisterCallback('asc_onShowComment', this.onApiShowComment); api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment); api.asc_unregisterCallback('asc_onShowRevisionsChange', this.onApiShowChange); + api.asc_unregisterCallback('asc_onShowPopMenu', this.checkShapeSelection); Common.Notifications.off('showSplitModal', this.ShowModal); } @@ -132,6 +135,15 @@ class ContextMenu extends ContextMenuController { } } + checkShapeSelection() { + const objects = this.props.objects; + const contextMenuElem = document.querySelector('#idx-context-menu-popover'); + + if(objects.indexOf('shape') > -1) { + contextMenuElem.style.top = `${+(contextMenuElem.style.top.replace(/px$/, '')) - 40}px`; + } + } + onTableContentsUpdate(type, currentTOC) { const api = Common.EditorApi.get(); let props = api.asc_GetTableOfContentsPr(currentTOC); @@ -232,6 +244,7 @@ class ContextMenu extends ContextMenuController { api.asc_registerCallback('asc_onShowComment', this.onApiShowComment); api.asc_registerCallback('asc_onHideComment', this.onApiHideComment); api.asc_registerCallback('asc_onShowRevisionsChange', this.onApiShowChange); + api.asc_registerCallback('asc_onShowPopMenu', this.checkShapeSelection); Common.Notifications.on('showSplitModal', this.ShowModal); }