Fix ids for field blocks.

This commit is contained in:
Sean Lip
2016-07-22 17:38:47 -07:00
parent 8d6ce713bd
commit 9e11acda49

View File

@@ -63,10 +63,13 @@ blocklyApp.WorkspaceTreeComponent = ng.core
<!-- TODO(madeeha): i18n here will need to happen in a different way due to the way grammar changes based on language. -->
<label [id]="idMap['inputMenuLabel' + i]"> {{utilsService.getInputTypeLabel(inputBlock.connection)}} {{utilsService.getBlockTypeLabel(inputBlock)}} needed: </label>
<ol role="group">
<li [id]="idMap['markSpot' + i]" role="treeitem" *ngFor="#fieldButtonInfo of fieldButtonsInfo"
<li *ngFor="#fieldButtonInfo of fieldButtonsInfo"
[id]="idMap[fieldButtonInfo.baseIdKey]" role="treeitem"
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap[fieldButtonInfo.baseIdKey + 'Button'], 'blockly-button', fieldButtonInfo.isDisabled(inputBlock.connection))"
[attr.aria-level]="level + 2">
<button [id]="idMap[fieldButtonInfo.baseIdKey + 'Button']" (click)="fieldButtonInfo.action(inputBlock.connection)">
<button [id]="idMap[fieldButtonInfo.baseIdKey + 'Button']"
(click)="fieldButtonInfo.action(inputBlock.connection)"
[disabled]="fieldButtonInfo.isDisabled(inputBlock.connection)">
{{fieldButtonInfo.translationIdForText|translate}}
</button>
</li>
@@ -291,6 +294,9 @@ blocklyApp.WorkspaceTreeComponent = ng.core
this.actionButtonsInfo.forEach(function(buttonInfo) {
that.idKeys.push(buttonInfo.baseIdKey, buttonInfo.baseIdKey + 'Button');
});
this.fieldButtonsInfo.forEach(function(buttonInfo) {
that.idKeys.push(buttonInfo.baseIdKey, buttonInfo.baseIdKey + 'Button');
});
for (var i = 0; i < this.block.inputList.length; i++) {
var inputBlock = this.block.inputList[i];
if (inputBlock.connection && !inputBlock.connection.targetBlock()) {