mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
Merge pull request #1889 from rachel-fenichel/bugfix/1780
Fix undoing a drag to connect
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user