Update availble connections when we have unplugged a block (#3954)

* Update availble connections when we have unplugged a block
This commit is contained in:
alschmiedt
2020-06-11 10:50:23 -07:00
committed by GitHub
parent 0272401dcb
commit b2650e6cef
2 changed files with 10 additions and 0 deletions

View File

@@ -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

View File

@@ -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.