mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
feat: rendered workspace comment (#7918)
* feat: add basic rendered workspace comment * feat: add updating the view and model * feat: add support for setting editability * feat: add moveTo support * feat: add disposing * chore: add tsdoc * fix: disposing of the comment when the delete icon is clicked * feat: add isDeadOrDying
This commit is contained in:
@@ -35,7 +35,10 @@ export class WorkspaceComment {
|
||||
private location = new Coordinate(0, 0);
|
||||
|
||||
/** Whether this comment has been disposed or not. */
|
||||
private disposed = false;
|
||||
protected disposed = false;
|
||||
|
||||
/** Whether this comment is being disposed or not. */
|
||||
protected disposing = false;
|
||||
|
||||
/**
|
||||
* Constructs the comment.
|
||||
@@ -158,6 +161,7 @@ export class WorkspaceComment {
|
||||
|
||||
/** Disposes of this comment. */
|
||||
dispose() {
|
||||
this.disposing = true;
|
||||
this.disposed = true;
|
||||
}
|
||||
|
||||
@@ -165,4 +169,12 @@ export class WorkspaceComment {
|
||||
isDisposed() {
|
||||
return this.disposed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this comment view is currently being disposed or has
|
||||
* already been disposed.
|
||||
*/
|
||||
isDeadOrDying(): boolean {
|
||||
return this.disposing || this.disposed;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user