mirror of
https://github.com/google/blockly.git
synced 2026-01-10 10:27:08 +01:00
More work on connection type checks
This commit is contained in:
@@ -456,7 +456,8 @@ Blockly.Block.prototype.unplugFromRow_ = function(opt_healStack) {
|
||||
// Disconnect the child block.
|
||||
childConnection.disconnect();
|
||||
// Connect child to the parent if possible, otherwise bump away.
|
||||
if (childConnection.checkType(parentConnection)) {
|
||||
if (this.workspace.connectionTypeChecker.canConnect(
|
||||
childConnection, parentConnection, false, false)) {
|
||||
parentConnection.connect(childConnection);
|
||||
} else {
|
||||
childConnection.onFailedConnect(parentConnection);
|
||||
@@ -508,7 +509,9 @@ Blockly.Block.prototype.unplugFromStack_ = function(opt_healStack) {
|
||||
// Disconnect the next statement.
|
||||
var nextTarget = this.nextConnection.targetConnection;
|
||||
nextTarget.disconnect();
|
||||
if (previousTarget && previousTarget.checkType(nextTarget)) {
|
||||
if (previousTarget &&
|
||||
this.workspace.connectionTypeChecker.canConnect(
|
||||
previousTarget, nextTarget, false, false)) {
|
||||
// Attach the next statement to the previous statement.
|
||||
previousTarget.connect(nextTarget);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user