mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Prevent fatal errors in browsers that don't support dataset.
This commit is contained in:
@@ -101,7 +101,9 @@ Blockly.BlockSvg = function(workspace, prototypeName, opt_id) {
|
||||
workspace, prototypeName, opt_id);
|
||||
|
||||
// Expose this block's ID on its top-level SVG group.
|
||||
this.svgGroup_.dataset.blockId = this.id;
|
||||
if (this.svgGroup_.dataset) {
|
||||
this.svgGroup_.dataset.id = this.id;
|
||||
}
|
||||
};
|
||||
goog.inherits(Blockly.BlockSvg, Blockly.Block);
|
||||
|
||||
|
||||
@@ -287,7 +287,9 @@ Blockly.Bubble.prototype.getSvgRoot = function() {
|
||||
* @param {string} id ID of block.
|
||||
*/
|
||||
Blockly.Bubble.prototype.setSvgId = function(id) {
|
||||
this.bubbleGroup_.dataset.id = id;
|
||||
if (this.bubbleGroup_.dataset) {
|
||||
this.bubbleGroup_.dataset.blockId = id;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user