mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
updateVariableName -> refreshVariableName
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user