From 02d60a2dbe5dd83296af53939f74e15683a7b01f Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Sun, 6 Mar 2016 14:51:03 -0800 Subject: [PATCH] Group variable rename into same event. --- core/connection.js | 6 +++--- core/variables.js | 2 ++ msg/js/lt.js | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/connection.js b/core/connection.js index bd6c05973..81017f21c 100644 --- a/core/connection.js +++ b/core/connection.js @@ -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}; }; diff --git a/core/variables.js b/core/variables.js index 46deb7619..12b8eeb06 100644 --- a/core/variables.js +++ b/core/variables.js @@ -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); }; /** diff --git a/msg/js/lt.js b/msg/js/lt.js index 9fd4a39d9..9816c7057 100644 --- a/msg/js/lt.js +++ b/msg/js/lt.js @@ -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ą";