mirror of
https://github.com/google/blockly.git
synced 2026-01-10 10:27:08 +01:00
Add information about the surrounding parent to the block description, for context.
This commit is contained in:
@@ -30,9 +30,9 @@ blocklyApp.ToolboxTreeComponent = ng.core
|
||||
template: `
|
||||
<li [id]="idMap['toolboxBlockRoot']" role="treeitem"
|
||||
[ngClass]="{blocklyHasChildren: displayBlockMenu}"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap['blockSummary'], 'blockly-toolbox-block')"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap['toolboxBlockSummary'], 'blockly-toolbox-block')"
|
||||
[attr.aria-level]="level">
|
||||
<label #blockSummary [id]="idMap['blockSummary']">{{getBlockDescription()}}</label>
|
||||
<label #toolboxBlockSummary [id]="idMap['toolboxBlockSummary']">{{getBlockDescription()}}</label>
|
||||
<ol role="group" *ngIf="displayBlockMenu">
|
||||
<li [id]="idMap['sendToSelected']" role="treeitem" *ngIf="!isWorkspaceEmpty()"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap['sendToSelectedButton'], 'blockly-button')"
|
||||
@@ -73,7 +73,7 @@ blocklyApp.ToolboxTreeComponent = ng.core
|
||||
this.utilsService = _utilsService;
|
||||
}],
|
||||
ngOnInit: function() {
|
||||
var idKeys = ['toolboxBlockRoot', 'blockSummary'];
|
||||
var idKeys = ['toolboxBlockRoot', 'toolboxBlockSummary'];
|
||||
if (this.displayBlockMenu) {
|
||||
idKeys = idKeys.concat([
|
||||
'workspaceCopy', 'workspaceCopyButton', 'sendToSelected',
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user