Merge pull request #3915 from GermanBluefox/patch-4

Do not add COLLAPSED_WARNINGS_WARNING by deleting of warning
This commit is contained in:
Rachel Fenichel
2020-05-26 14:13:48 -07:00
committed by GitHub

View File

@@ -1135,22 +1135,22 @@ Blockly.BlockSvg.prototype.setWarningText = function(text, opt_id) {
text = null;
}
// Bubble up to add a warning on top-most collapsed block.
var parent = this.getSurroundParent();
var collapsedParent = null;
while (parent) {
if (parent.isCollapsed()) {
collapsedParent = parent;
}
parent = parent.getSurroundParent();
}
if (collapsedParent) {
collapsedParent.setWarningText(Blockly.Msg['COLLAPSED_WARNINGS_WARNING'],
Blockly.BlockSvg.COLLAPSED_WARNING_ID);
}
var changedState = false;
if (typeof text == 'string') {
// Bubble up to add a warning on top-most collapsed block.
var parent = this.getSurroundParent();
var collapsedParent = null;
while (parent) {
if (parent.isCollapsed()) {
collapsedParent = parent;
}
parent = parent.getSurroundParent();
}
if (collapsedParent) {
collapsedParent.setWarningText(Blockly.Msg['COLLAPSED_WARNINGS_WARNING'],
Blockly.BlockSvg.COLLAPSED_WARNING_ID);
}
if (!this.warning) {
this.warning = new Blockly.Warning(this);
changedState = true;