mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +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) {
|
constructor(private readonly workspace: WorkspaceSvg) {
|
||||||
this.svgRoot = dom.createSvgElement(Svg.G, {
|
this.svgRoot = dom.createSvgElement(Svg.G, {
|
||||||
'class': 'blocklyComment blocklyEditable',
|
'class': 'blocklyComment blocklyEditable blocklyDraggable',
|
||||||
});
|
});
|
||||||
|
|
||||||
this.highlightRect = this.createHighlightRect(this.svgRoot);
|
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.
|
// Set the size to the default size as defined in the superclass.
|
||||||
this.view.setSize(this.getSize());
|
this.view.setSize(this.getSize());
|
||||||
this.view.setEditable(this.isEditable());
|
this.view.setEditable(this.isEditable());
|
||||||
|
this.view.getSvgRoot().setAttribute('data-id', this.id);
|
||||||
|
|
||||||
this.addModelUpdateBindings();
|
this.addModelUpdateBindings();
|
||||||
|
|
||||||
|
|||||||
@@ -748,7 +748,6 @@ export class Workspace implements IASTNodeLocation {
|
|||||||
*
|
*
|
||||||
* @param id ID of comment to find.
|
* @param id ID of comment to find.
|
||||||
* @returns The sought after comment, or null if not found.
|
* @returns The sought after comment, or null if not found.
|
||||||
* @internal
|
|
||||||
*/
|
*/
|
||||||
getCommentById(id: string): WorkspaceComment | null {
|
getCommentById(id: string): WorkspaceComment | null {
|
||||||
return this.commentDB.get(id) ?? null;
|
return this.commentDB.get(id) ?? null;
|
||||||
|
|||||||
Reference in New Issue
Block a user