Fix error thrown when disconnecting blocks that have never been dragged.

This commit is contained in:
Neil Fraser
2016-04-02 04:53:04 -07:00
parent 5be735f24f
commit 2ce0a25f92
2 changed files with 3 additions and 0 deletions

View File

@@ -828,6 +828,8 @@ Blockly.BlockSvg.prototype.onMouseMove_ = function(e) {
if (this.parentBlock_) {
// Push this block to the very top of the stack.
this.unplug();
var group = this.getSvgRoot();
group.translate_ = 'translate(' + newXY.x + ',' + newXY.y + ')';
this.disconnectUiEffect();
}
this.setDragging_(true);

View File

@@ -64,6 +64,7 @@ Blockly.Connection.REASON_DIFFERENT_WORKSPACES = 5;
* Connect two connections together.
* @param {!Blockly.Connection} parentConnection Connection on superior block.
* @param {!Blockly.Connection} childConnection Connection on inferior block.
* @private
*/
Blockly.Connection.connect_ = function(parentConnection, childConnection) {
var parentBlock = parentConnection.getSourceBlock();