Add glowBlock method to WorkspaceSvg

This commit is contained in:
Tim Mickel 2016-03-04 10:27:57 -05:00
parent 348564cd76
commit c48c2234fb

View file

@ -454,6 +454,24 @@ Blockly.WorkspaceSvg.prototype.highlightBlock = function(id) {
setTimeout(function() {thisWorkspace.traceOn(true);}, 1);
};
/**
* Glow/unglow a block in the workspace.
* @param {?string} id ID of block to find.
* @param {boolean} isGlowing Whether to glow the block.
*/
Blockly.WorkspaceSvg.prototype.glowBlock = function(id, isGlowing) {
var block = null;
if (id) {
block = Blockly.Block.getById(id);
if (!block) {
return;
}
}
if (block) {
block.setGlow(isGlowing);
}
};
/**
* Paste the provided block onto the workspace.
* @param {!Element} xmlBlock XML block element.