Expose block ID in SVG. (#1698)

This commit is contained in:
Neil Fraser
2018-03-12 14:04:03 -07:00
committed by RoboErikG
parent 6203cadcae
commit c7b29d0bc0

View File

@@ -99,6 +99,9 @@ Blockly.BlockSvg = function(workspace, prototypeName, opt_id) {
Blockly.Tooltip.bindMouseEvents(this.svgPath_);
Blockly.BlockSvg.superClass_.constructor.call(this,
workspace, prototypeName, opt_id);
// Expose this block's ID on its top-level SVG group.
this.svgGroup_.id = this.id;
};
goog.inherits(Blockly.BlockSvg, Blockly.Block);