Group variable rename into same event.

This commit is contained in:
Neil Fraser 2016-03-06 14:51:03 -08:00
parent 65af8e58d4
commit 02d60a2dbe
3 changed files with 6 additions and 4 deletions

View file

@ -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);
};
/**