Make 'WITH' text field be optional (for Blockly Games).

This commit is contained in:
Neil Fraser
2015-01-06 16:29:27 -08:00
parent 14e76b2bc5
commit c6fc29b4a2
2 changed files with 5 additions and 2 deletions

View File

@@ -536,7 +536,10 @@ Blockly.Blocks['procedures_callnoreturn'] = {
}
}
// Add 'with:' if there are parameters.
this.getField_('WITH').setVisible(!!this.arguments_.length);
var withField = this.getField_('WITH');
if (withField) {
withField.setVisible(!!this.arguments_.length);
}
// Restore rendering and show the changes.
this.rendered = savedRendered;
if (this.rendered) {