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:
parent
8cb212d897
commit
257b1f89f3
@ -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()
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user