Merge pull request #1889 from rachel-fenichel/bugfix/1780

Fix undoing a drag to connect
This commit is contained in:
Rachel Fenichel
2018-05-23 15:11:33 -07:00
committed by GitHub
2 changed files with 3 additions and 7 deletions

View File

@@ -224,9 +224,9 @@ Blockly.BlockDragger.prototype.endBlockDrag = function(e, currentDragDeltaXY) {
// These are expensive and don't need to be done if we're deleting.
this.draggingBlock_.moveConnections_(delta.x, delta.y);
this.draggingBlock_.setDragging(false);
this.fireMoveEvent_();
this.draggedConnectionManager_.applyConnections();
this.draggingBlock_.render();
this.fireMoveEvent_();
this.draggingBlock_.scheduleSnapAndBump();
}
this.workspace_.setResizesEnabled(true);

View File

@@ -279,12 +279,8 @@ Blockly.BlockSvg.prototype.setParent = function(newParent) {
// If we are losing a parent, we want to move our DOM element to the
// root of the workspace.
else if (oldParent) {
// Avoid moving a block up the DOM if it's currently selected/dragging,
// so as to avoid taking things off the drag surface.
if (Blockly.selected != this) {
this.workspace.getCanvas().appendChild(svgRoot);
this.translate(oldXY.x, oldXY.y);
}
this.workspace.getCanvas().appendChild(svgRoot);
this.translate(oldXY.x, oldXY.y);
}
};