Make variable add set/get block in context menu obey block limits (#938 from bwinf/develop)

This commit is contained in:
Andrew n marshall
2017-02-16 08:26:13 -08:00
committed by GitHub

View File

@@ -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);