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

@ -336,7 +336,7 @@ Blockly.Connection.prototype.checkConnection_ = function(target) {
/**
* Check if the two connections can be dragged to connect to each other.
* @param {Blockly.Connection} candidate A nearby connection to check.
* @param {!Blockly.Connection} candidate A nearby connection to check.
* @param {number} maxRadius The maximum radius allowed for connections.
* @return {boolean} True if the connection is allowed, false otherwise.
*/
@ -346,7 +346,7 @@ Blockly.Connection.prototype.isConnectionAllowed = function(candidate,
return false;
}
// Type checking
// Type checking.
var canConnect = this.canConnectWithReason_(candidate);
if (canConnect != Blockly.Connection.CAN_CONNECT &&
canConnect != Blockly.Connection.REASON_MUST_DISCONNECT) {
@ -649,7 +649,7 @@ Blockly.Connection.prototype.closest = function(maxLimit, dx, dy) {
dy);
if (closestConnection) {
return {connection: closestConnection,
radius: this.distanceFrom(closestConnection)};
radius: this.distanceFrom(closestConnection)};
}
return {connection: null, radius: maxLimit};
};

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

View file

@ -62,7 +62,7 @@ Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL = "kartok, kol pasieksi";
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "kartok kol";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL = "Kartoja veiksmus, kol bus pasiekta nurodyta sąlyga.";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "Kartoja veiksmus, kol sąlyga tenkinama.";
Blockly.Msg.DELETE_ALL_BLOCKS = "Delete all %1 blocks?"; // untranslated
Blockly.Msg.DELETE_ALL_BLOCKS = "Ištrinti visus %1 blokus?";
Blockly.Msg.DELETE_BLOCK = "Ištrinti bloką";
Blockly.Msg.DELETE_X_BLOCKS = "Ištrinti %1 blokus";
Blockly.Msg.DISABLE_BLOCK = "Išjungti bloką";