mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Allow escape key to close context menu
This commit is contained in:
parent
eaa85ae8d5
commit
03f758720c
@ -192,16 +192,12 @@ RED.contextMenu = (function() {
|
||||
disposeMenu()
|
||||
});
|
||||
menu.show();
|
||||
|
||||
// menu.show({
|
||||
// target: $('#red-ui-main-container'),
|
||||
// x: options.x,
|
||||
// y: options.y
|
||||
// })
|
||||
|
||||
// set focus to first item so that pressing escape key closes the menu
|
||||
$("#red-ui-workspace-context-menu :first(ul) > a").trigger("focus")
|
||||
|
||||
}
|
||||
|
||||
// Allow escape key hook and other editor events to close context menu
|
||||
RED.keyboard.add("red-ui-workspace-context-menu", "escape", function () { RED.contextMenu.hide() })
|
||||
return {
|
||||
show: show,
|
||||
hide: disposeMenu
|
||||
|
Loading…
Reference in New Issue
Block a user