mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
Redo the fixes to event groups in connection.js
This commit is contained in:
committed by
Rachel Fenichel
parent
060c2b34df
commit
fa6f41f395
@@ -444,6 +444,10 @@ Blockly.Connection.prototype.connect = function(otherConnection) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.checkConnection_(otherConnection);
|
this.checkConnection_(otherConnection);
|
||||||
|
var eventGroup = Blockly.Events.getGroup();
|
||||||
|
if (!eventGroup) {
|
||||||
|
Blockly.Events.setGroup(true);
|
||||||
|
}
|
||||||
// Determine which block is superior (higher in the source stack).
|
// Determine which block is superior (higher in the source stack).
|
||||||
if (this.isSuperior()) {
|
if (this.isSuperior()) {
|
||||||
// Superior block.
|
// Superior block.
|
||||||
@@ -452,6 +456,9 @@ Blockly.Connection.prototype.connect = function(otherConnection) {
|
|||||||
// Inferior block.
|
// Inferior block.
|
||||||
otherConnection.connect_(this);
|
otherConnection.connect_(this);
|
||||||
}
|
}
|
||||||
|
if (!eventGroup) {
|
||||||
|
Blockly.Events.setGroup(false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -541,8 +548,16 @@ Blockly.Connection.prototype.disconnect = function() {
|
|||||||
childBlock = this.sourceBlock_;
|
childBlock = this.sourceBlock_;
|
||||||
parentConnection = otherConnection;
|
parentConnection = otherConnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var eventGroup = Blockly.Events.getGroup();
|
||||||
|
if (!eventGroup) {
|
||||||
|
Blockly.Events.setGroup(true);
|
||||||
|
}
|
||||||
this.disconnectInternal_(parentBlock, childBlock);
|
this.disconnectInternal_(parentBlock, childBlock);
|
||||||
parentConnection.respawnShadow_();
|
parentConnection.respawnShadow_();
|
||||||
|
if (!eventGroup) {
|
||||||
|
Blockly.Events.setGroup(false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user