diff --git a/core/field_variable.js b/core/field_variable.js index 850e2c378..336c84a02 100644 --- a/core/field_variable.js +++ b/core/field_variable.js @@ -147,11 +147,8 @@ Blockly.FieldVariable.prototype.initModel = function() { this.sourceBlock_.workspace, null, this.defaultVariableName, this.defaultType_); - // Don't fire a change event for this setValue. It would have null as the - // old value, which is not valid. - Blockly.Events.disable(); - this.setValue(variable.getId()); - Blockly.Events.enable(); + // Don't call setValue because we don't want to cause a rerender. + this.doValueUpdate_(variable.getId()); }; /** diff --git a/core/mutator.js b/core/mutator.js index decb81f3a..c864c9f8d 100644 --- a/core/mutator.js +++ b/core/mutator.js @@ -372,15 +372,10 @@ Blockly.Mutator.prototype.workspaceChanged_ = function(e) { var block = this.block_; var oldMutationDom = block.mutationToDom(); var oldMutation = oldMutationDom && Blockly.Xml.domToText(oldMutationDom); - // Switch off rendering while the source block is rebuilt. - var savedRendered = block.rendered; - block.rendered = false; // Allow the source block to rebuild itself. block.compose(this.rootBlock_); - // Restore rendering and show the changes. - block.rendered = savedRendered; - // Mutation may have added some elements that need initializing. block.initSvg(); + block.render(); var newMutationDom = block.mutationToDom(); var newMutation = newMutationDom && Blockly.Xml.domToText(newMutationDom); if (oldMutation != newMutation) { @@ -394,9 +389,6 @@ Blockly.Mutator.prototype.workspaceChanged_ = function(e) { Blockly.Events.setGroup(false); }, Blockly.BUMP_DELAY); } - if (block.rendered) { - block.render(); - } if (oldMutation != newMutation && this.workspace_.keyboardAccessibilityMode) {