Also listen to right-button in menus. #456

This commit is contained in:
Neil Fraser
2016-10-23 07:31:15 -07:00
parent 4d65b606bd
commit 12e6a7a535

View File

@@ -66,6 +66,10 @@ Blockly.ContextMenu.show = function(e, options, rtl) {
if (option.enabled) {
goog.events.listen(menuItem, goog.ui.Component.EventType.ACTION,
option.callback);
menuItem.handleContextMenu = function(e) {
// Right-clicking on menu option should count as a click.
goog.events.dispatchEvent(this, goog.ui.Component.EventType.ACTION);
};
}
}
goog.events.listen(menu, goog.ui.Component.EventType.ACTION,