Skip to main content

Class: CollapseCommentBarButton

Defined in: packages/blockly/core/comments/collapse_comment_bar_button.ts:25

Button that toggles the collapsed state of a comment.

Extends​

Properties index​

PropertyDescription
iconSVG image displayed on this button.
idThe ID of this button's parent comment.
workspaceThe workspace this button's parent comment is on.
containerAn SVG group that this button should be a child of.
commentView-

Methods index​

MethodDescription
disposeDisposes of this button.
repositionAdjusts the positioning of this button within its container.
performActionToggles the collapsed state of the parent comment.
getAriaLabelReturns the ARIA label to use for this button (defaults to null). Note that this method will only be called and apply when recomputeAriaContext is called.
isVisibleReturns whether or not this button is currently visible.
getCommentViewReturns the parent comment view of this comment bar button.
getSizeReturns the dimensions of this button in workspace coordinates.
getMarginReturns the margin in workspace coordinates surrounding this button.
getFocusableElementReturns a DOM element representing this button that can receive focus.
getFocusableTreeReturns the workspace this button is a child of.
onNodeFocusCalled when this button's focusable DOM element gains focus.
onNodeBlurCalled when this button's focusable DOM element loses focus.
canBeFocusedReturns whether this button can be focused. True if it is visible.
recomputeAriaContextRecomputes the ARIA label and role for this button. Note that this is not automatically called during initialization and must be called once a button's focusable element (icon) is initialized. Implementations may also find it useful to call this if the button's label should be changed.

Constructors​

Constructor​

new CollapseCommentBarButton(
id,
workspace,
container,
commentView
): CollapseCommentBarButton;

Defined in: packages/blockly/core/comments/collapse_comment_bar_button.ts:43

Creates a new CollapseCommentBarButton instance.

Parameters​

ParameterTypeDescription
idstringThe ID of this button's parent comment.
workspaceWorkspaceSvgThe workspace this button's parent comment is displayed on.
containerSVGGElementAn SVG group that this button should be a child of.
commentViewCommentView-

Returns​

CollapseCommentBarButton

Overrides​

CommentBarButton.constructor

Properties​

icon​

protected readonly icon: SVGImageElement;

Defined in: packages/blockly/core/comments/collapse_comment_bar_button.ts:34

SVG image displayed on this button.

Overrides​

CommentBarButton.icon


id​

readonly id: string;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:31

The ID of this button's parent comment.

Inherited from​

DeleteCommentBarButton.id


workspace​

protected readonly workspace: WorkspaceSvg;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:32

The workspace this button's parent comment is on.

Inherited from​

DeleteCommentBarButton.workspace


container​

protected readonly container: SVGGElement;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:33

An SVG group that this button should be a child of.

Inherited from​

DeleteCommentBarButton.container


commentView​

protected readonly commentView: CommentView;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:34

Inherited from​

DeleteCommentBarButton.commentView

Methods​

dispose()​

dispose(): void;

Defined in: packages/blockly/core/comments/collapse_comment_bar_button.ts:77

Disposes of this button.

Returns​

void


reposition()​

reposition(): void;

Defined in: packages/blockly/core/comments/collapse_comment_bar_button.ts:84

Adjusts the positioning of this button within its container.

Returns​

void

Overrides​

CommentBarButton.reposition


performAction()​

performAction(e?): void;

Defined in: packages/blockly/core/comments/collapse_comment_bar_button.ts:95

Toggles the collapsed state of the parent comment.

Parameters​

ParameterTypeDescription
e?EventThe event that triggered this action.

Returns​

void

Overrides​

CommentBarButton.performAction


getAriaLabel()​

protected getAriaLabel(): string;

Defined in: packages/blockly/core/comments/collapse_comment_bar_button.ts:117

Returns the ARIA label to use for this button (defaults to null). Note that this method will only be called and apply when recomputeAriaContext is called.

Returns​

string

The ARIA label to use for this button, or null to use a default.

Overrides​

CommentBarButton.getAriaLabel


isVisible()​

isVisible(): boolean;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:40

Returns whether or not this button is currently visible.

Returns​

boolean

Inherited from​

CommentBarButton.isVisible


getCommentView()​

getCommentView(): CommentView;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:47

Returns the parent comment view of this comment bar button.

Returns​

CommentView

Inherited from​

CommentBarButton.getCommentView


getSize()​

getSize(includeMargin?): Rect;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:63

Returns the dimensions of this button in workspace coordinates.

Parameters​

ParameterTypeDefault valueDescription
includeMarginbooleanfalseTrue to include the margin when calculating the size.

Returns​

Rect

The size of this button.

Inherited from​

CommentBarButton.getSize


getMargin()​

getMargin(): number;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:77

Returns the margin in workspace coordinates surrounding this button.

Returns​

number

Inherited from​

CommentBarButton.getMargin


getFocusableElement()​

getFocusableElement(): SVGImageElement;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:82

Returns a DOM element representing this button that can receive focus.

Returns​

SVGImageElement

Inherited from​

CommentBarButton.getFocusableElement


getFocusableTree()​

getFocusableTree(): WorkspaceSvg;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:87

Returns the workspace this button is a child of.

Returns​

WorkspaceSvg

Inherited from​

CommentBarButton.getFocusableTree


onNodeFocus()​

onNodeFocus(): void;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:92

Called when this button's focusable DOM element gains focus.

Returns​

void

Inherited from​

CommentBarButton.onNodeFocus


onNodeBlur()​

onNodeBlur(): void;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:101

Called when this button's focusable DOM element loses focus.

Returns​

void

Inherited from​

CommentBarButton.onNodeBlur


canBeFocused()​

canBeFocused(): boolean;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:104

Returns whether this button can be focused. True if it is visible.

Returns​

boolean

Inherited from​

CommentBarButton.canBeFocused


recomputeAriaContext()​

protected recomputeAriaContext(): void;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:114

Recomputes the ARIA label and role for this button. Note that this is not automatically called during initialization and must be called once a button's focusable element (icon) is initialized. Implementations may also find it useful to call this if the button's label should be changed.

Returns​

void

Inherited from​

CommentBarButton.recomputeAriaContext