Add information about the surrounding parent to the block description, for context.

This commit is contained in:
Sean Lip
2016-09-23 18:33:59 -07:00
parent ea846abc9f
commit 09f25f618f
2 changed files with 13 additions and 4 deletions

View File

@@ -115,7 +115,16 @@ blocklyApp.WorkspaceTreeComponent = ng.core
this.audioService = _audioService;
}],
getBlockDescription: function() {
return this.utilsService.getBlockDescription(this.block);
var blockDescription = this.utilsService.getBlockDescription(this.block);
var parentBlock = this.block.getSurroundParent();
if (parentBlock) {
var fullDescription = blockDescription + ' inside ' +
this.utilsService.getBlockDescription(parentBlock);
return fullDescription;
} else {
return blockDescription;
}
},
removeBlockAndSetFocus_: function(block, deleteBlockFunc) {
this.treeService.removeBlockAndSetFocus(