Skip to content

Commit

Permalink
fix(comments): added workspace comments and comment drag strategy isD…
Browse files Browse the repository at this point in the history
…eadOrDying() checks (#8532)

* fix: added id to rendered ws comments; made getCommentById public; added blocklyDraggable class to ws comments

* fix: added workspace comments and comment drag strategy isDeadOrDying checks

* chore: removed .idea files

* chore: formatted with prettier
  • Loading branch information
changminbark authored Sep 3, 2024
1 parent 074a549 commit 4d0fd5d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion core/comments/workspace_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ export class WorkspaceComment {
* workspace is read-only.
*/
isDeletable(): boolean {
return this.isOwnDeletable() && !this.workspace.options.readOnly;
return (
this.isOwnDeletable() &&
!this.isDeadOrDying() &&
!this.workspace.options.readOnly
);
}

/**
Expand Down
6 changes: 5 additions & 1 deletion core/dragging/comment_drag_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export class CommentDragStrategy implements IDragStrategy {
}

isMovable(): boolean {
return this.comment.isOwnMovable() && !this.workspace.options.readOnly;
return (
this.comment.isOwnMovable() &&
!this.comment.isDeadOrDying() &&
!this.workspace.options.readOnly
);
}

startDrag(): void {
Expand Down

0 comments on commit 4d0fd5d

Please sign in to comment.