From c82c460da83b613049dc70cda5a609d566c7b70e Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Wed, 30 Sep 2015 19:33:05 -0700 Subject: [PATCH] Move icon reference to block SVG. No functional change. --- core/block.js | 6 ------ core/block_svg.js | 13 +++++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) 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).