Merge pull request #1742 from samelhusseini/contextmenuflyout

Don't show create VAR and create Function context menu options when in the flyout
This commit is contained in:
Rachel Fenichel
2018-03-28 10:52:47 -07:00
committed by GitHub
2 changed files with 6 additions and 0 deletions

View File

@@ -261,6 +261,9 @@ Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN = {
* @this Blockly.Block
*/
customContextMenu: function(options) {
if (this.isInFlyout){
return;
}
var varName = this.getFieldValue('VAR');
if (!this.isCollapsed() && varName != null) {
var option = {enabled: true};

View File

@@ -355,6 +355,9 @@ Blockly.Blocks['procedures_defnoreturn'] = {
* @this Blockly.Block
*/
customContextMenu: function(options) {
if (this.isInFlyout){
return;
}
// Add option to create caller.
var option = {enabled: true};
var name = this.getFieldValue('NAME');