From ec8d76f143691e838d3f5163d19a41859e44a50b Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Tue, 25 Feb 2020 14:32:51 -0800 Subject: [PATCH] Add workspace comment context menu option to playground (#3708) * Add WScomment context menu option to playground --- core/workspace_svg.js | 3 ++- tests/playground.html | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 202b23969..0b748763f 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -395,6 +395,7 @@ Blockly.WorkspaceSvg.prototype.toolboxCategoryCallbacks_ = {}; * Developers may define this function to add custom menu options to the * workspace's context menu or edit the workspace-created set of menu options. * @param {!Array.} options List of menu options to add to. + * @param {!Event} e The right-click event that triggered the context menu. */ Blockly.WorkspaceSvg.prototype.configureContextMenu; @@ -1800,7 +1801,7 @@ Blockly.WorkspaceSvg.prototype.showContextMenu = function(e) { // Allow the developer to add or modify menuOptions. if (this.configureContextMenu) { - this.configureContextMenu(menuOptions); + this.configureContextMenu(menuOptions, e); } Blockly.ContextMenu.show(e, menuOptions, this.RTL); diff --git a/tests/playground.html b/tests/playground.html index 6290f937c..7a4379346 100644 --- a/tests/playground.html +++ b/tests/playground.html @@ -69,12 +69,18 @@