diff --git a/core/block.js b/core/block.js index 3adc9a479..8f5dedee9 100644 --- a/core/block.js +++ b/core/block.js @@ -1078,7 +1078,7 @@ Blockly.Block.prototype.updateVarName = function(variable) { for (var j = 0, field; field = input.fieldRow[j]; j++) { if (field.referencesVariables() && variable.getId() == field.getValue()) { - field.updateVariableName(); + field.refreshVariableName(); } } } diff --git a/core/field_variable.js b/core/field_variable.js index 5e5761b39..7f93b9244 100644 --- a/core/field_variable.js +++ b/core/field_variable.js @@ -342,11 +342,12 @@ Blockly.FieldVariable.prototype.setTypes_ = function(opt_variableTypes, }; /** - * A callback to update the name of a variable. Should only be called by - * the block. + * Refreshes the name of the variable by grabbing the name of the model. + * Used when a variable gets renamed, but the ID stays the same. Should only + * be called by the block. * @package */ -Blockly.FieldVariable.prototype.updateVariableName = function() { +Blockly.FieldVariable.prototype.refreshVariableName = function() { this.text_ = this.variable_.name; this.forceRerender(); };