diff --git a/core/block.js b/core/block.js index 5d4170ea9..a3c320103 100644 --- a/core/block.js +++ b/core/block.js @@ -508,12 +508,6 @@ Blockly.Block.prototype.setEditable = function(editable) { field.updateEditable(); } } - if (this.rendered) { - var icons = this.getIcons(); - for (var i = 0; i < icons.length; i++) { - icons[i].updateEditable(); - } - } }; /** diff --git a/core/block_svg.js b/core/block_svg.js index 510d48130..50c6bd0b6 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -789,6 +789,19 @@ Blockly.BlockSvg.prototype.setMovable = function(movable) { this.updateMovable(); }; +/** + * Set whether this block is editable or not. + * @param {boolean} movable True if editable. + */ +Blockly.BlockSvg.prototype.setEditable = function(editable) { + Blockly.BlockSvg.superClass_.setEditable.call(this, editable); + if (this.rendered) { + for (var i = 0; i < this.icons_.length; i++) { + this.icons_[i].updateEditable(); + } + } +}; + /** * Return the root node of the SVG or null if none exists. * @return {Element} The root SVG node (probably a group).