1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

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

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({ menu = RED.menu.init({
direction: 'right', direction: direction,
onpreselect: function() { onpreselect: function() {
disposeMenu() disposeMenu()
}, },