Stay organized with collections Save and categorize content based on your preferences.

blockly > IFlyout

IFlyout interface

Interface for a flyout.

Signature:

export interface IFlyout extends IRegistrable 

Extends: IRegistrable

Properties

Property Modifiers Type Description
autoClose boolean Does the flyout automatically close when a block is created?
CORNER_RADIUS readonly number Corner radius of the flyout background.
horizontalLayout boolean Whether the flyout is laid out horizontally or not.
MARGIN readonly number Margin around the edges of the blocks in the flyout.
RTL boolean Is RTL vs LTR.
targetWorkspace WorkspaceSvg | null The target workspace

Methods

Method Description
createBlock(originalBlock) Create a copy of this block on the workspace.
createDom(tagName) Creates the flyout's DOM. Only needs to be called once. The flyout can either exist as its own svg element or be a g element nested inside a separate svg element.
dispose() Dispose of this flyout. Unlink from all DOM elements to prevent memory leaks.
getHeight() Get the height of the flyout.
getWidth() Get the width of the flyout.
getWorkspace() Get the workspace inside the flyout.
getX() Calculates the x coordinate for the flyout position.
getY() Calculates the y coordinate for the flyout position.
hide() Hide and empty the flyout.
init(targetWorkspace) Initializes the flyout.
isBlockCreatable(block) Does this flyout allow you to create a new instance of the given block? Used for deciding if a block can be "dragged out of" the flyout.
isDragTowardWorkspace(currentDragDeltaXY) Determine if a drag delta is toward the workspace, based on the position and orientation of the flyout. This is used in determineDragIntention_ to determine if a new block should be created or if the flyout should scroll.
isScrollable()
isVisible() Is the flyout visible?
position() Position the flyout.
reflow() Reflow blocks and their mats.
scrollToStart() Scroll the flyout to the beginning of its contents.
setContainerVisible(visible) Set whether this flyout's container is visible.
setVisible(visible) Set whether the flyout is visible. A value of true does not necessarily mean that the flyout is shown. It could be hidden because its container is hidden.
show(flyoutDef) Show and populate the flyout.