diff --git a/core/connection.js b/core/connection.js index bfde24cff..082cfc441 100644 --- a/core/connection.js +++ b/core/connection.js @@ -444,6 +444,10 @@ Blockly.Connection.prototype.connect = function(otherConnection) { return; } this.checkConnection_(otherConnection); + var eventGroup = Blockly.Events.getGroup(); + if (!eventGroup) { + Blockly.Events.setGroup(true); + } // Determine which block is superior (higher in the source stack). if (this.isSuperior()) { // Superior block. @@ -452,6 +456,9 @@ Blockly.Connection.prototype.connect = function(otherConnection) { // Inferior block. otherConnection.connect_(this); } + if (!eventGroup) { + Blockly.Events.setGroup(false); + } }; /** @@ -541,8 +548,16 @@ Blockly.Connection.prototype.disconnect = function() { childBlock = this.sourceBlock_; parentConnection = otherConnection; } + + var eventGroup = Blockly.Events.getGroup(); + if (!eventGroup) { + Blockly.Events.setGroup(true); + } this.disconnectInternal_(parentBlock, childBlock); parentConnection.respawnShadow_(); + if (!eventGroup) { + Blockly.Events.setGroup(false); + } }; /**