diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index 570faff17..7f2d289e1 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -670,6 +670,8 @@ define([ left = 0; } } + if (left < 0) + left = 0; if (this.options.restoreHeightAndTop) { // can change top position, if top<0 - then change menu height var cg = Common.Utils.croppedGeometry(); @@ -1181,6 +1183,8 @@ define([ left = 0; } } + if (left < 0) + left = 0; if (this.options.restoreHeight) { if (typeof (this.options.restoreHeight) == "number") { diff --git a/apps/documenteditor/main/app/controller/DocumentHolder.js b/apps/documenteditor/main/app/controller/DocumentHolder.js index 56b678462..17d28f09f 100644 --- a/apps/documenteditor/main/app/controller/DocumentHolder.js +++ b/apps/documenteditor/main/app/controller/DocumentHolder.js @@ -2442,6 +2442,9 @@ define([ eqContainer.css({left: showPoint[0], top : showPoint[1]}); var menuAlign = (me._Height - showPoint[1] - eqContainer.outerHeight() < 220) ? 'bl-tl' : 'tl-bl'; + if (Common.UI.isRTL()) { + menuAlign = menuAlign === 'bl-tl' ? 'br-tr' : 'tr-br'; + } me.equationBtns.forEach(function(item){ item && (item.menu.menuAlign = menuAlign); }); diff --git a/apps/documenteditor/main/app/view/SignatureSettings.js b/apps/documenteditor/main/app/view/SignatureSettings.js index c2cf3cdb0..e7b3de188 100644 --- a/apps/documenteditor/main/app/view/SignatureSettings.js +++ b/apps/documenteditor/main/app/view/SignatureSettings.js @@ -219,7 +219,7 @@ define([ this.showSignatureMenu(record, showPoint); - menu.menuAlign = 'tl-bl'; + menu.menuAlign = Common.UI.isRTL() ? 'tr-br' : 'tl-bl'; menu.menuAlignEl = null; menu.setOffset(15, 5); menu.show(); @@ -246,7 +246,7 @@ define([ this.showSignatureMenu(record, showPoint); - menu.menuAlign = 'tr-br'; + menu.menuAlign = Common.UI.isRTL() ? 'tl-bl' : 'tr-br'; menu.menuAlignEl = currentTarget; menu.setOffset(-20, -currentTarget.height()/2 + 3); menu.show(); diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js index 05d5192e4..c1f8f47ae 100644 --- a/apps/presentationeditor/main/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js @@ -2355,6 +2355,9 @@ define([ eqContainer.css({left: showPoint[0], top : showPoint[1]}); var menuAlign = (me._Height - showPoint[1] - eqContainer.outerHeight() < 220) ? 'bl-tl' : 'tl-bl'; + if (Common.UI.isRTL()) { + menuAlign = menuAlign === 'bl-tl' ? 'br-tr' : 'tr-br'; + } me.equationBtns.forEach(function(item){ item && (item.menu.menuAlign = menuAlign); }); diff --git a/apps/presentationeditor/main/app/view/SignatureSettings.js b/apps/presentationeditor/main/app/view/SignatureSettings.js index fafb4a9f9..933b57068 100644 --- a/apps/presentationeditor/main/app/view/SignatureSettings.js +++ b/apps/presentationeditor/main/app/view/SignatureSettings.js @@ -188,7 +188,7 @@ define([ this.showSignatureMenu(record, showPoint); - menu.menuAlign = 'tl-bl'; + menu.menuAlign = Common.UI.isRTL() ? 'tr-br' : 'tl-bl'; menu.menuAlignEl = null; menu.setOffset(15, 5); menu.show(); @@ -215,7 +215,7 @@ define([ this.showSignatureMenu(record, showPoint); - menu.menuAlign = 'tr-br'; + menu.menuAlign = Common.UI.isRTL() ? 'tl-bl' : 'tr-br'; menu.menuAlignEl = currentTarget; menu.setOffset(-20, -currentTarget.height()/2 + 3); menu.show(); diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 3bd7f7e85..04625bc0a 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -2609,6 +2609,9 @@ define([ menuContainer.css({left: showPoint[0], top : showPoint[1]}); menu.menuAlign = validation ? 'tr-br' : 'tl-bl'; + if (Common.UI.isRTL()) { + menu.menuAlign = menu.menuAlign === 'tr-br' ? 'tl-bl' : 'tr-br'; + } me._preventClick = validation; validation && menuContainer.attr('data-value', 'prevent-canvas-click'); @@ -4373,6 +4376,9 @@ define([ eqContainer.css({left: showPoint[0], top : showPoint[1]}); var menuAlign = (me.tooltips.coauth.apiHeight - showPoint[1] - eqContainer.outerHeight() < 220) ? 'bl-tl' : 'tl-bl'; + if (Common.UI.isRTL()) { + menuAlign = menuAlign === 'bl-tl' ? 'br-tr' : 'tr-br'; + } me.equationBtns.forEach(function(item){ item && (item.menu.menuAlign = menuAlign); }); diff --git a/apps/spreadsheeteditor/main/app/view/SignatureSettings.js b/apps/spreadsheeteditor/main/app/view/SignatureSettings.js index 2c78d2b67..c3d6c910c 100644 --- a/apps/spreadsheeteditor/main/app/view/SignatureSettings.js +++ b/apps/spreadsheeteditor/main/app/view/SignatureSettings.js @@ -214,7 +214,7 @@ define([ this.showSignatureMenu(record, showPoint); - menu.menuAlign = 'tl-bl'; + menu.menuAlign = Common.UI.isRTL() ? 'tr-br' : 'tl-bl'; menu.menuAlignEl = null; menu.setOffset(15, 5); menu.show(); @@ -241,7 +241,7 @@ define([ this.showSignatureMenu(record, showPoint); - menu.menuAlign = 'tr-br'; + menu.menuAlign = Common.UI.isRTL() ? 'tl-bl' : 'tr-br'; menu.menuAlignEl = currentTarget; menu.setOffset(-20, -currentTarget.height()/2 + 3); menu.show();