mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Move 'create new group' button to the bottom of each toolbox block, and remove other buttons if there is nothing in the workspace.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
}
|
||||
.blocklyWorkspaceColumn {
|
||||
float: left;
|
||||
width: 300px;
|
||||
width: 350px;
|
||||
}
|
||||
.blocklyToolbarColumn {
|
||||
float: left;
|
||||
|
||||
@@ -34,21 +34,14 @@ blocklyApp.ToolboxTreeComponent = ng.core
|
||||
[attr.aria-level]="level">
|
||||
<label #blockSummaryLabel [id]="idMap['blockSummaryLabel']">{{getBlockDescription()}}</label>
|
||||
<ol role="group" *ngIf="displayBlockMenu">
|
||||
<li [id]="idMap['workspaceCopy']" role="treeitem"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap['workspaceCopyButton'], 'blockly-button')"
|
||||
[attr.aria-level]="level + 2">
|
||||
<button [id]="idMap['workspaceCopyButton']" (click)="copyToWorkspace()" tabindex="-1">
|
||||
{{'COPY_TO_WORKSPACE'|translate}}
|
||||
</button>
|
||||
</li>
|
||||
<li [id]="idMap['blockCopy']" role="treeitem"
|
||||
<li [id]="idMap['blockCopy']" role="treeitem" *ngIf="!isWorkspaceEmpty()"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap['blockCopyButton'], 'blockly-button')"
|
||||
[attr.aria-level]="level + 2">
|
||||
<button [id]="idMap['blockCopyButton']" (click)="copyToClipboard()" tabindex="-1">
|
||||
{{'COPY_TO_CLIPBOARD'|translate}}
|
||||
</button>
|
||||
</li>
|
||||
<li [id]="idMap['sendToSelected']" role="treeitem"
|
||||
<li [id]="idMap['sendToSelected']" role="treeitem" *ngIf="!isWorkspaceEmpty()"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap['sendToSelectedButton'], 'blockly-button', !canBeCopiedToMarkedConnection())"
|
||||
[attr.aria-level]="level + 2">
|
||||
<button [id]="idMap['sendToSelectedButton']" (click)="copyToMarkedSpot()"
|
||||
@@ -56,6 +49,13 @@ blocklyApp.ToolboxTreeComponent = ng.core
|
||||
{{'COPY_TO_MARKED_SPOT'|translate}}
|
||||
</button>
|
||||
</li>
|
||||
<li [id]="idMap['workspaceCopy']" role="treeitem"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap['workspaceCopyButton'], 'blockly-button')"
|
||||
[attr.aria-level]="level + 2">
|
||||
<button [id]="idMap['workspaceCopyButton']" (click)="copyToWorkspace()" tabindex="-1">
|
||||
{{'COPY_TO_WORKSPACE'|translate}}
|
||||
</button>
|
||||
</li>
|
||||
</ol>
|
||||
</li>
|
||||
|
||||
@@ -107,6 +107,9 @@ blocklyApp.ToolboxTreeComponent = ng.core
|
||||
});
|
||||
}
|
||||
},
|
||||
isWorkspaceEmpty: function() {
|
||||
return this.utilsService.isWorkspaceEmpty();
|
||||
},
|
||||
getBlockDescription: function() {
|
||||
return this.utilsService.getBlockDescription(this.block);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user