mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Defer comment rendering if workspace not rendered
When a Blockly workspace has not been rendered for the first time, e.g. due to Firefox SVG exceptions, the comment bubbles do not have a canvas to attach to. This fix sets a `visible` field on the comment object during load of a Blockly workspace that can be used to trigger an SVG update once the workspace has been rendered.
This commit is contained in:
@@ -165,6 +165,11 @@ Blockly.Comment.prototype.resizeBubble_ = function() {
|
||||
* @param {boolean} visible True if the bubble should be visible.
|
||||
*/
|
||||
Blockly.Comment.prototype.setVisible = function(visible) {
|
||||
if (!this.block_.workspace.rendered) {
|
||||
this.rendered = false;
|
||||
this.visible = visible;
|
||||
return;
|
||||
}
|
||||
if (visible == this.isVisible()) {
|
||||
// No change.
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user