mirror of
https://github.com/google/blockly.git
synced 2025-12-15 13:50:08 +01:00
fix: added id to rendered ws comments; made getCommentById public; added blocklyDraggable class to ws comments (#8358)
This commit is contained in:
@@ -104,7 +104,7 @@ export class CommentView implements IRenderedElement {
|
||||
|
||||
constructor(private readonly workspace: WorkspaceSvg) {
|
||||
this.svgRoot = dom.createSvgElement(Svg.G, {
|
||||
'class': 'blocklyComment blocklyEditable',
|
||||
'class': 'blocklyComment blocklyEditable blocklyDraggable',
|
||||
});
|
||||
|
||||
this.highlightRect = this.createHighlightRect(this.svgRoot);
|
||||
|
||||
@@ -57,6 +57,7 @@ export class RenderedWorkspaceComment
|
||||
// Set the size to the default size as defined in the superclass.
|
||||
this.view.setSize(this.getSize());
|
||||
this.view.setEditable(this.isEditable());
|
||||
this.view.getSvgRoot().setAttribute('data-id', this.id);
|
||||
|
||||
this.addModelUpdateBindings();
|
||||
|
||||
|
||||
@@ -748,7 +748,6 @@ export class Workspace implements IASTNodeLocation {
|
||||
*
|
||||
* @param id ID of comment to find.
|
||||
* @returns The sought after comment, or null if not found.
|
||||
* @internal
|
||||
*/
|
||||
getCommentById(id: string): WorkspaceComment | null {
|
||||
return this.commentDB.get(id) ?? null;
|
||||
|
||||
Reference in New Issue
Block a user