mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Fix event related missing requires (#4656)
* Fix event related missing requires
This commit is contained in:
@@ -106,7 +106,8 @@ Blockly.VariableMap.prototype.renameVariableById = function(id, newName) {
|
||||
*/
|
||||
Blockly.VariableMap.prototype.renameVariableAndUses_ = function(variable,
|
||||
newName, blocks) {
|
||||
Blockly.Events.fire(new Blockly.Events.VarRename(variable, newName));
|
||||
Blockly.Events.fire(new (Blockly.Events.get(Blockly.Events.VAR_RENAME))(
|
||||
variable, newName));
|
||||
variable.name = newName;
|
||||
for (var i = 0; i < blocks.length; i++) {
|
||||
blocks[i].updateVarName(variable);
|
||||
@@ -143,7 +144,8 @@ Blockly.VariableMap.prototype.renameVariableWithConflict_ = function(variable,
|
||||
}
|
||||
|
||||
// Finally delete the original variable, which is now unreferenced.
|
||||
Blockly.Events.fire(new Blockly.Events.VarDelete(variable));
|
||||
Blockly.Events.fire(new (Blockly.Events.get(Blockly.Events.VAR_DELETE))(
|
||||
variable));
|
||||
// And remove it from the list.
|
||||
var variableList = this.getVariablesOfType(type);
|
||||
var variableIndex = variableList.indexOf(variable);
|
||||
@@ -205,7 +207,8 @@ Blockly.VariableMap.prototype.deleteVariable = function(variable) {
|
||||
for (var i = 0, tempVar; (tempVar = variableList[i]); i++) {
|
||||
if (tempVar.getId() == variable.getId()) {
|
||||
variableList.splice(i, 1);
|
||||
Blockly.Events.fire(new Blockly.Events.VarDelete(variable));
|
||||
Blockly.Events.fire(new (Blockly.Events.get(Blockly.Events.VAR_DELETE))(
|
||||
variable));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user