Commit a239c720 authored by Neil Fraser's avatar Neil Fraser

Don't update shadows on connections since they are immutable.

parent d702808f
...@@ -161,14 +161,10 @@ Blockly.Connection.prototype.connect = function(otherConnection) { ...@@ -161,14 +161,10 @@ Blockly.Connection.prototype.connect = function(otherConnection) {
// Can't make a value connection if male block is already connected. // Can't make a value connection if male block is already connected.
throw 'Source connection already connected (value).'; throw 'Source connection already connected (value).';
} else if (otherConnection.targetConnection) { } 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. // If female block is already connected, disconnect and bump the male.
var orphanBlock = otherConnection.targetBlock(); var orphanBlock = otherConnection.targetBlock();
orphanBlock.setParent(null); orphanBlock.setParent(null);
if (orphanBlock.isShadow()) { if (orphanBlock.isShadow()) {
otherConnection.setShadowDom(Blockly.Xml.blockToDom_(orphanBlock));
orphanBlock.dispose(); orphanBlock.dispose();
} else { } else {
if (!orphanBlock.outputConnection) { if (!orphanBlock.outputConnection) {
...@@ -194,8 +190,6 @@ Blockly.Connection.prototype.connect = function(otherConnection) { ...@@ -194,8 +190,6 @@ Blockly.Connection.prototype.connect = function(otherConnection) {
orphanBlock.outputConnection.bumpAwayFrom_(otherConnection); orphanBlock.outputConnection.bumpAwayFrom_(otherConnection);
}, Blockly.BUMP_DELAY); }, Blockly.BUMP_DELAY);
} }
// Restore the shadow.
otherConnection.setShadowDom(shadowDom);
} }
} }
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment