Commit 9ae15246 authored by Evan W. Patton's avatar Evan W. Patton Committed by Susan Rati Lane

Reuse flydown SVG rather than making orphans (#1876)

Change-Id: I34fc7bb333208d59e9186800fe2696621c9971af
parent 1967dba7
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment