Skip to content

Commit 4cdca28

Browse files
authored
fix: added id to rendered ws comments; made getCommentById public; added blocklyDraggable class to ws comments (#8358)
1 parent e634b51 commit 4cdca28

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

core/comments/comment_view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class CommentView implements IRenderedElement {
104104

105105
constructor(private readonly workspace: WorkspaceSvg) {
106106
this.svgRoot = dom.createSvgElement(Svg.G, {
107-
'class': 'blocklyComment blocklyEditable',
107+
'class': 'blocklyComment blocklyEditable blocklyDraggable',
108108
});
109109

110110
this.highlightRect = this.createHighlightRect(this.svgRoot);

core/comments/rendered_workspace_comment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export class RenderedWorkspaceComment
5757
// Set the size to the default size as defined in the superclass.
5858
this.view.setSize(this.getSize());
5959
this.view.setEditable(this.isEditable());
60+
this.view.getSvgRoot().setAttribute('data-id', this.id);
6061

6162
this.addModelUpdateBindings();
6263

core/workspace.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,6 @@ export class Workspace implements IASTNodeLocation {
748748
*
749749
* @param id ID of comment to find.
750750
* @returns The sought after comment, or null if not found.
751-
* @internal
752751
*/
753752
getCommentById(id: string): WorkspaceComment | null {
754753
return this.commentDB.get(id) ?? null;

0 commit comments

Comments
 (0)