Class: BlockFlyoutInflater
Defined in: packages/blockly/core/block_flyout_inflater.ts:36
Class responsible for creating blocks for flyouts.
Implements
Properties index
| Property | Description |
|---|---|
| permanentlyDisabledBlocks | - |
| listeners | - |
| flyout | - |
Methods index
| Method | Description |
|---|---|
| load | Inflates a flyout block from the given state and adds it to the flyout. |
| createBlock | Creates a block on the given workspace. |
| gapForItem | Returns the amount of space that should follow this block. |
| disposeItem | Disposes of the given block. |
| removeListeners | Removes event listeners for the block with the given ID. |
| setFlyout | Updates this inflater's flyout. |
| addBlockListeners | Add listeners to a block that has been added to the flyout. |
| getType | Returns the type of items this inflater is responsible for creating. |
Constructors
Constructor
new BlockFlyoutInflater(): BlockFlyoutInflater;
Defined in: packages/blockly/core/block_flyout_inflater.ts:45
Creates a new BlockFlyoutInflater instance.
Returns
BlockFlyoutInflater
Properties
permanentlyDisabledBlocks
protected permanentlyDisabledBlocks: Set<BlockSvg>;
Defined in: packages/blockly/core/block_flyout_inflater.ts:37
listeners
protected listeners: Map<string, Data[]>;
Defined in: packages/blockly/core/block_flyout_inflater.ts:38
flyout?
protected optional flyout?: IFlyout;
Defined in: packages/blockly/core/block_flyout_inflater.ts:39
Methods
load()
load(state, flyout): FlyoutItem;
Defined in: packages/blockly/core/block_flyout_inflater.ts:56
Inflates a flyout block from the given state and adds it to the flyout.
Parameters
| Parameter | Type | Description |
|---|---|---|
state | object | A JSON representation of a flyout block. |
flyout | IFlyout | The flyout to create the block on. |
Returns
A newly created block.
Implementation of
createBlock()
createBlock(blockDefinition, workspace): BlockSvg;
Defined in: packages/blockly/core/block_flyout_inflater.ts:113
Creates a block on the given workspace.
Parameters
| Parameter | Type | Description |
|---|---|---|
blockDefinition | BlockInfo | A JSON representation of the block to create. |
workspace | WorkspaceSvg | The workspace to create the block on. |
Returns
The newly created block.
gapForItem()
gapForItem(state, defaultGap): number;
Defined in: packages/blockly/core/block_flyout_inflater.ts:156
Returns the amount of space that should follow this block.
Parameters
| Parameter | Type | Description |
|---|---|---|
state | object | A JSON representation of a flyout block. |
defaultGap | number | The default spacing for flyout items. |
Returns
number
The amount of space that should follow this block.
Implementation of
disposeItem()
disposeItem(item): void;
Defined in: packages/blockly/core/block_flyout_inflater.ts:178
Disposes of the given block.
Parameters
| Parameter | Type | Description |
|---|---|---|
item | FlyoutItem | The flyout block to dispose of. |
Returns
void
Implementation of
removeListeners()
protected removeListeners(blockId): void;
Defined in: packages/blockly/core/block_flyout_inflater.ts:191
Removes event listeners for the block with the given ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
blockId | string | The ID of the block to remove event listeners from. |
Returns
void
setFlyout()
protected setFlyout(flyout): void;
Defined in: packages/blockly/core/block_flyout_inflater.ts:202
Updates this inflater's flyout.
Parameters
| Parameter | Type | Description |
|---|---|---|
flyout | IFlyout | The flyout that owns this inflater. |
Returns
void
addBlockListeners()
protected addBlockListeners(block): void;
Defined in: packages/blockly/core/block_flyout_inflater.ts:237
Add listeners to a block that has been added to the flyout.
Parameters
| Parameter | Type | Description |
|---|---|---|
block | BlockSvg | The block to add listeners for. |
Returns
void
getType()
getType(): string;
Defined in: packages/blockly/core/block_flyout_inflater.ts:305
Returns the type of items this inflater is responsible for creating.
Returns
string
An identifier for the type of items this inflater creates.