mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
Merge pull request #3915 from GermanBluefox/patch-4
Do not add COLLAPSED_WARNINGS_WARNING by deleting of warning
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user