Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions packages/blockly/core/comments/collapse_comment_bar_button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,24 @@ export class CollapseCommentBarButton extends CommentBarButton {
* @param container An SVG group that this button should be a child of.
*/
constructor(
protected readonly id: string,
protected readonly workspace: WorkspaceSvg,
protected readonly container: SVGGElement,
protected readonly commentView: CommentView,
id: string,
workspace: WorkspaceSvg,
container: SVGGElement,
commentView: CommentView,
) {
super(id, workspace, container, commentView);
super(
`${id}${COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER}`,
workspace,
container,
commentView,
);

this.icon = dom.createSvgElement(
Svg.IMAGE,
{
'class': 'blocklyFoldoutIcon',
'href': `${this.workspace.options.pathToMedia}foldout-icon.svg`,
'id': `${this.id}${COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER}`,
'id': this.id,
},
this.container,
);
Expand Down
2 changes: 1 addition & 1 deletion packages/blockly/core/comments/comment_bar_button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export abstract class CommentBarButton implements IFocusableNode {
* @param container An SVG group that this button should be a child of.
*/
constructor(
protected readonly id: string,
readonly id: string,
protected readonly workspace: WorkspaceSvg,
protected readonly container: SVGGElement,
protected readonly commentView: CommentView,
Expand Down
17 changes: 11 additions & 6 deletions packages/blockly/core/comments/delete_comment_bar_button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,24 @@ export class DeleteCommentBarButton extends CommentBarButton {
* @param container An SVG group that this button should be a child of.
*/
constructor(
protected readonly id: string,
protected readonly workspace: WorkspaceSvg,
protected readonly container: SVGGElement,
protected readonly commentView: CommentView,
id: string,
workspace: WorkspaceSvg,
container: SVGGElement,
commentView: CommentView,
) {
super(id, workspace, container, commentView);
super(
`${id}${COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER}`,
workspace,
container,
commentView,
);

this.icon = dom.createSvgElement(
Svg.IMAGE,
{
'class': 'blocklyDeleteIcon',
'href': `${this.workspace.options.pathToMedia}delete-icon.svg`,
'id': `${this.id}${COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER}`,
'id': this.id,
},
container,
);
Expand Down
3 changes: 1 addition & 2 deletions packages/blockly/core/workspace_svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2977,8 +2977,7 @@ export class WorkspaceSvg
return (
comment.view
.getCommentBarButtons()
.find((button) => button.getFocusableElement().id.includes(id)) ??
null
.find((button) => button.id.includes(id)) ?? null
);
}
}
Expand Down