mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Add glowBlock method to WorkspaceSvg
This commit is contained in:
parent
348564cd76
commit
c48c2234fb
1 changed files with 18 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue