From d59c4a92db14fcd34c7ca11d9714e543c036fc53 Mon Sep 17 00:00:00 2001 From: Erik Pasternak Date: Fri, 19 Jul 2019 16:08:53 -0700 Subject: [PATCH] Redo the fixes to event groups in connection.js --- core/connection.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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); + } }; /**