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()
|
disposeMenu()
|
||||||
});
|
});
|
||||||
menu.show();
|
menu.show();
|
||||||
|
// set focus to first item so that pressing escape key closes the menu
|
||||||
// menu.show({
|
$("#red-ui-workspace-context-menu :first(ul) > a").trigger("focus")
|
||||||
// target: $('#red-ui-main-container'),
|
|
||||||
// x: options.x,
|
|
||||||
// y: options.y
|
|
||||||
// })
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// 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 {
|
return {
|
||||||
show: show,
|
show: show,
|
||||||
hide: disposeMenu
|
hide: disposeMenu
|
||||||
|
Loading…
x
Reference in New Issue
Block a user