mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-14 06:59:01 -04:00
Group variable rename into same event.
This commit is contained in:
parent
65af8e58d4
commit
02d60a2dbe
3 changed files with 6 additions and 4 deletions
core
|
@ -80,11 +80,13 @@ Blockly.Variables.allVariables = function(root) {
|
|||
* @param {!Blockly.Workspace} workspace Workspace rename variables in.
|
||||
*/
|
||||
Blockly.Variables.renameVariable = function(oldName, newName, workspace) {
|
||||
Blockly.Events.setGroup(true);
|
||||
var blocks = workspace.getAllBlocks();
|
||||
// Iterate through every block.
|
||||
for (var i = 0; i < blocks.length; i++) {
|
||||
blocks[i].renameVar(oldName, newName);
|
||||
}
|
||||
Blockly.Events.setGroup(false);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue