fix display direction of context sub-menu

This commit is contained in:
Hiroyasu Nishiyama 2022-07-07 16:47:26 +09:00
parent 8cb212d897
commit 257b1f89f3
1 changed files with 9 additions and 1 deletions

View File

@ -152,8 +152,16 @@ RED.contextMenu = (function() {
}
}
var direction = "right";
var MENU_WIDTH = 600; // can not use menu width here
if ((options.x -$(document).scrollLeft()) >
($(window).height() -MENU_WIDTH)) {
direction = "left";
}
menu = RED.menu.init({
direction: 'right',
direction: direction,
onpreselect: function() {
disposeMenu()
},