From c7b29d0bc0e748ce95a3f1a45118106579249e73 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Mon, 12 Mar 2018 14:04:03 -0700 Subject: [PATCH] Expose block ID in SVG. (#1698) --- core/block_svg.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/block_svg.js b/core/block_svg.js index 0653f476d..d799c2ea2 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -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);