Reuse flydown SVG rather than making orphans
@@ -151,12 +151,11 @@ Blockly.FieldFlydown.prototype.showFlydown_ = function() {
Blockly.hideChaff(); // Hide open context menus, dropDowns, flyouts, and other flydowns
Blockly.FieldFlydown.openFieldFlydown_ = this; // Remember field to which flydown is attached
var flydown = Blockly.getMainWorkspace().getFlydown();
- var flydownSvg = flydown.createDom(this.flyoutCSSClassName);
// Add flydown to top-level svg, *not* to main workspace svg
// This is essential for correct positioning of flydown via translation
// (If it's in workspace svg, it will be additionally translated by
// workspace svg translation relative to Blockly.svg.)
- Blockly.getMainWorkspace().getParentSvg().appendChild(flydownSvg);
+ Blockly.getMainWorkspace().getParentSvg().appendChild(flydown.svgGroup_);
// adjust scale for current zoom level
flydown.workspace_.setScale(flydown.targetWorkspace_.scale);
flydown.setCSSClass(this.flyoutCSSClassName); // This could have been changed by another field.
