Skip to content

Commit

Permalink
Don't update shadows on connections since they are immutable.
Browse files Browse the repository at this point in the history
  • Loading branch information
NeilFraser committed Nov 22, 2015
1 parent d702808 commit a239c72
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions core/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,10 @@ Blockly.Connection.prototype.connect = function(otherConnection) {
// Can't make a value connection if male block is already connected.
throw 'Source connection already connected (value).';
} else if (otherConnection.targetConnection) {
// Record and disable the shadow so that it does not respawn here.
var shadowDom = otherConnection.getShadowDom();
otherConnection.setShadowDom(null);
// If female block is already connected, disconnect and bump the male.
var orphanBlock = otherConnection.targetBlock();
orphanBlock.setParent(null);
if (orphanBlock.isShadow()) {
otherConnection.setShadowDom(Blockly.Xml.blockToDom_(orphanBlock));
orphanBlock.dispose();
} else {
if (!orphanBlock.outputConnection) {
Expand All @@ -194,8 +190,6 @@ Blockly.Connection.prototype.connect = function(otherConnection) {
orphanBlock.outputConnection.bumpAwayFrom_(otherConnection);
}, Blockly.BUMP_DELAY);
}
// Restore the shadow.
otherConnection.setShadowDom(shadowDom);
}
}
} else {
Expand Down

0 comments on commit a239c72

Please sign in to comment.