mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
Revert "Properly set the display style on blocks when connections are unhidden"
This reverts commit bacfae24dd.
This commit is contained in:
committed by
Rachel Fenichel
parent
198e445cb7
commit
a002621ec2
@@ -283,12 +283,6 @@ Blockly.RenderedConnection.prototype.setHidden = function(hidden) {
|
||||
} else if (!hidden && !this.inDB_) {
|
||||
this.db_.addConnection(this);
|
||||
}
|
||||
if (this.isSuperior() && this.targetBlock()) {
|
||||
var display = hidden ? 'none' : 'block';
|
||||
var renderedBlock = this.targetBlock();
|
||||
renderedBlock.getSvgRoot().style.display = display;
|
||||
renderedBlock.rendered = !hidden;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -350,6 +344,11 @@ Blockly.RenderedConnection.prototype.connect = function(otherConnection) {
|
||||
} else {
|
||||
superiorConnection.unhideAll();
|
||||
}
|
||||
|
||||
var renderedBlock = superiorConnection.targetBlock();
|
||||
var display = superiorConnection.hidden_ ? 'none' : 'block';
|
||||
renderedBlock.getSvgRoot().style.display = display;
|
||||
renderedBlock.rendered = !superiorConnection.hidden_;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -359,17 +358,17 @@ Blockly.RenderedConnection.prototype.connect = function(otherConnection) {
|
||||
*/
|
||||
Blockly.RenderedConnection.prototype.disconnect = function() {
|
||||
var superiorConnection = this.isSuperior() ? this : this.targetConnection;
|
||||
var rehide = false;
|
||||
if (this.targetConnection && superiorConnection.hidden_) {
|
||||
superiorConnection.unhideAll();
|
||||
rehide = true;
|
||||
}
|
||||
Blockly.RenderedConnection.superClass_.disconnect.call(this);
|
||||
if (rehide) {
|
||||
var renderedBlock = superiorConnection.targetBlock();
|
||||
renderedBlock.getSvgRoot().style.display = 'block';
|
||||
renderedBlock.rendered = true;
|
||||
|
||||
// Set the hidden state for the connection back to true so shadow blocks
|
||||
// will be hidden.
|
||||
superiorConnection.setHidden(true);
|
||||
}
|
||||
Blockly.RenderedConnection.superClass_.disconnect.call(this);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user