mirror of
https://github.com/google/blockly.git
synced 2026-01-05 08:00:09 +01:00
* Revert "Localisation updates from https://translatewiki.net." This reverts commitc4a0b64945. * Revert "Fix #1960 by collecting block info before icons are destroyed (#1970)" This reverts commit9a3bd45b22.
This commit is contained in:
@@ -837,27 +837,16 @@ Blockly.BlockSvg.prototype.dispose = function(healStack, animate) {
|
||||
this.warningTextDb_ = null;
|
||||
}
|
||||
|
||||
// If the block is rendered we need to record the event before disposing of
|
||||
// the icons to prevent losing information.
|
||||
// TODO (#1969): Remove event generation/firing once comments are fixed.
|
||||
var deleteEvent;
|
||||
if (Blockly.Events.isEnabled()) {
|
||||
deleteEvent = new Blockly.Events.BlockDelete(this);
|
||||
}
|
||||
Blockly.Events.disable();
|
||||
try {
|
||||
var icons = this.getIcons();
|
||||
for (var i = 0; i < icons.length; i++) {
|
||||
icons[i].dispose();
|
||||
}
|
||||
// TODO (#1969): Move out of disable block once comments are fixed.
|
||||
Blockly.BlockSvg.superClass_.dispose.call(this, healStack);
|
||||
} finally {
|
||||
Blockly.Events.enable();
|
||||
}
|
||||
if (Blockly.Events.isEnabled() && deleteEvent) {
|
||||
Blockly.Events.fire(deleteEvent);
|
||||
}
|
||||
Blockly.BlockSvg.superClass_.dispose.call(this, healStack);
|
||||
|
||||
this.svgGroup_.parentNode.removeChild(this.svgGroup_);
|
||||
blockWorkspace.resizeContents();
|
||||
|
||||
Reference in New Issue
Block a user