From b2650e6cefb7f43c379fc6e40f0795fe3aa66939 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 11 Jun 2020 10:50:23 -0700 Subject: [PATCH] Update availble connections when we have unplugged a block (#3954) * Update availble connections when we have unplugged a block --- core/block_dragger.js | 1 + core/insertion_marker_manager.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/core/block_dragger.js b/core/block_dragger.js index f30d9adf9..c38f4425b 100644 --- a/core/block_dragger.js +++ b/core/block_dragger.js @@ -162,6 +162,7 @@ Blockly.BlockDragger.prototype.startBlockDrag = function(currentDragDeltaXY, this.draggingBlock_.translate(newLoc.x, newLoc.y); Blockly.blockAnimations.disconnectUiEffect(this.draggingBlock_); + this.draggedConnectionManager_.updateAvailableConnections(); } this.draggingBlock_.setDragging(true); // For future consideration: we may be able to put moveToDragSurface inside diff --git a/core/insertion_marker_manager.js b/core/insertion_marker_manager.js index bb85cc960..2d47dd296 100644 --- a/core/insertion_marker_manager.js +++ b/core/insertion_marker_manager.js @@ -160,6 +160,15 @@ Blockly.InsertionMarkerManager.prototype.dispose = function() { } }; +/** + * Update the available connections for the top block. These connections can + * change if a block is unplugged and the stack is healed. + * @package + */ +Blockly.InsertionMarkerManager.prototype.updateAvailableConnections = function() { + this.availableConnections_ = this.initAvailableConnections_(); +}; + /** * Return whether the block would be deleted if dropped immediately, based on * information from the most recent move event.