Skip to main content

blockly > CollapsibleToolboxCategory

CollapsibleToolboxCategory class

Class for a category in a toolbox that can be collapsed.

Signature:

export declare class CollapsibleToolboxCategory extends ToolboxCategory implements ICollapsibleToolboxItem 

Extends: ToolboxCategory

Implements: ICollapsibleToolboxItem

Constructors

Constructor

Modifiers

Description

(constructor)(categoryDef, toolbox, opt_parent)

Constructs a new instance of the CollapsibleToolboxCategory class

Properties

Property

Modifiers

Type

Description

expanded_

protected

boolean

Whether or not the category should display its subcategories.

registrationName

static

string

Name used for registering a collapsible toolbox category.

subcategoriesDiv_

protected

HTMLDivElement | null

Container for any child categories.

toolboxItems_

protected

IToolboxItem[]

The child toolbox items for this category.

Methods

Method

Modifiers

Description

createDom_()

createIconDom_()

createSubCategoriesDom_(subcategories)

protected

Create the DOM for all subcategories.

getChildToolboxItems()

Gets any children toolbox items. (ex. Gets the subcategories)

getDiv()

init()

isCollapsible()

isExpanded()

Whether the category is expanded to show its child subcategories.

makeDefaultCssConfig_()

onClick(_e)

parseContents_(categoryDef)

setExpanded(isExpanded)

Opens or closes the current category and the associated flyout.

setVisible_(isVisible)

toggleExpanded()

Toggles whether or not the category is expanded.