chore: fix comments being resizable when readonly (#8043)

This commit is contained in:
Beka Westberg
2024-04-19 18:15:56 +00:00
committed by GitHub
parent 7246bbc0d1
commit 69c5557e4f
2 changed files with 7 additions and 1 deletions

View File

@@ -495,6 +495,8 @@ export class CommentView implements IRenderedElement {
* comment.
*/
private onResizePointerDown(e: PointerEvent) {
if (!this.isEditable()) return;
this.bringToFront();
if (browserEvents.isRightButton(e)) {
e.stopPropagation();
@@ -795,6 +797,9 @@ css.register(`
height: 12px;
cursor: se-resize;
}
.blocklyReadonly.blocklyComment .blocklyResizeHandle {
cursor: inherit;
}
.blocklyCommentTopbarBackground {
fill: var(--commentBorderColour);

View File

@@ -251,7 +251,8 @@
if (sessionStorage) {
sessionStorage.setItem('logFlyoutEvents', Number(state));
}
var flyoutWorkspace = workspace.getFlyout().getWorkspace();
var flyoutWorkspace = workspace.getFlyout()?.getWorkspace();
if (!flyoutWorkspace) return;
if (state) {
flyoutWorkspace.addChangeListener(logger);
} else {