From 7bba5f4a046d1f8f662c2830bd48a07486705bbe Mon Sep 17 00:00:00 2001 From: ShimaginAndrey Date: Thu, 24 Feb 2022 21:35:50 +0300 Subject: [PATCH] Fix selectors users --- .../mobile/lib/controller/ContextMenu.jsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/common/mobile/lib/controller/ContextMenu.jsx b/apps/common/mobile/lib/controller/ContextMenu.jsx index 8a91b862e..6bd4ad0de 100644 --- a/apps/common/mobile/lib/controller/ContextMenu.jsx +++ b/apps/common/mobile/lib/controller/ContextMenu.jsx @@ -175,6 +175,7 @@ class ContextMenuController extends Component { break; } } + if (!src) { src = $$(`
`); src.attr('userid', UserId); @@ -185,11 +186,20 @@ class ContextMenuController extends Component { //src.fadeIn(150); src[0].classList.add('active'); - $$('#id_main_view').append(src); + $$("#editor_sdk").append(src); } - src.css({ - top: (Y - tipHeight) + 'px', - left: X + 'px'}); + + if ( X + src.outerWidth() > $$(window).width() ) { + src.css({ + top: (Y - tipHeight) + 'px', + left: X - src.outerWidth() + 'px'}); + } else { + src.css({ + left: X + 'px', + top: (Y - tipHeight) + 'px', + }); + } + /** coauthoring end **/ }