mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Remove some TODOs; add a variable-referencing block to the simple playground flyout
This commit is contained in:
@@ -737,24 +737,6 @@ Blockly.Block.prototype.getVarModels = function() {
|
||||
return vars;
|
||||
};
|
||||
|
||||
/**
|
||||
* Notification that a variable is renaming.
|
||||
* TODO (#1498): consider deleting this.
|
||||
* If the name matches one of this block's variables, rename it.
|
||||
* @param {string} oldName Previous name of variable.
|
||||
* @param {string} newName Renamed variable.
|
||||
*/
|
||||
Blockly.Block.prototype.renameVar = function(oldName, newName) {
|
||||
for (var i = 0, input; input = this.inputList[i]; i++) {
|
||||
for (var j = 0, field; field = input.fieldRow[j]; j++) {
|
||||
if (field instanceof Blockly.FieldVariable &&
|
||||
Blockly.Names.equals(oldName, field.getValue())) {
|
||||
field.setValue(newName);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Notification that a variable is renaming but keeping the same ID. If the
|
||||
* variable is in use on this block, rerender to show the new name.
|
||||
|
||||
Reference in New Issue
Block a user