mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Use more descriptive ARIA labels for toolbox categories.
This commit is contained in:
parent
a263e29abd
commit
5268ca94b9
1 changed files with 4 additions and 1 deletions
|
@ -40,7 +40,7 @@ blocklyApp.ToolboxComponent = ng.core
|
|||
[ngClass]="{blocklyHasChildren: true, blocklyActiveDescendant: tree.getAttribute('aria-activedescendant') == idMap['Parent' + i]}"
|
||||
*ngFor="#category of toolboxCategories; #i=index"
|
||||
aria-level="1"
|
||||
[attr.aria-label]="category.attributes.name.value">
|
||||
[attr.aria-label]="getCategoryAriaLabel(category.attributes.name.value)">
|
||||
<div *ngIf="category && category.attributes">
|
||||
<label [id]="idMap['Label' + i]" #name>
|
||||
{{category.attributes.name.value}}
|
||||
|
@ -119,6 +119,9 @@ blocklyApp.ToolboxComponent = ng.core
|
|||
getActiveDescId: function() {
|
||||
return this.treeService.getActiveDescId('blockly-toolbox-tree');
|
||||
},
|
||||
getCategoryAriaLabel: function(categoryName) {
|
||||
return 'toolbox category ' + categoryName;
|
||||
},
|
||||
getToolboxWorkspace: function(categoryNode) {
|
||||
if (categoryNode.attributes && categoryNode.attributes.name) {
|
||||
var categoryName = categoryNode.attributes.name.value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue