From 5a7b7b3c5afea7a08164db99f0871e3410334d2f Mon Sep 17 00:00:00 2001 From: Robert Czechowski Date: Thu, 16 Feb 2017 15:03:50 +0100 Subject: [PATCH] Make variable add set/get block in context menu obey block limits --- blocks/variables.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/variables.js b/blocks/variables.js index d82a98bed..07ae8e6e5 100644 --- a/blocks/variables.js +++ b/blocks/variables.js @@ -111,7 +111,7 @@ Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN = { var contextMenuMsg = Blockly.Msg.VARIABLES_SET_CREATE_GET; } - var option = {enabled: true}; + var option = {enabled: this.workspace.remainingCapacity() > 0}; var name = this.getFieldValue('VAR'); option.text = contextMenuMsg.replace('%1', name); var xmlField = goog.dom.createDom('field', null, name);