Make variable add set/get block in context menu obey block limits

This commit is contained in:
Robert Czechowski
2017-02-16 15:03:50 +01:00
parent c3c1f83105
commit 5a7b7b3c5a

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