Events.BlockMove class
Notifies listeners when a block is moved. This could be from one connection to another, or from one location on the workspace to another.
Signature:
export declare class BlockMove extends BlockBase
Extends: BlockBase
Constructors
Constructor | Modifiers | Description |
|---|---|---|
Constructs a new instance of the |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
(Optional) The new X and Y workspace coordinates of the block if it is a top-level block. Undefined if it is not a top level block. | |||
string | (Optional) The name of the new input. Undefined if it is a top-level block or the parent's next block. | ||
string | (Optional) The ID of the new parent block. Undefined if it is a top-level block. | ||
(Optional) The old X and Y workspace coordinates of the block if it was a top level block. Undefined if it was not a top level block. | |||
string | (Optional) The name of the old input. Undefined if it was a top-level block or the parent's next block. | ||
string | (Optional) The ID of the old parent block. Undefined if it was a top-level block. | ||
string[] | (Optional) An explanation of what this move is for. Known values include: 'drag' -- A drag operation completed. 'bump' -- Block got bumped away from an invalid connection. 'snap' -- Block got shifted to line up with the grid. 'inbounds' -- Block got pushed back into a non-scrolling workspace. 'connect' -- Block got connected to another block. 'disconnect' -- Block got disconnected from another block. 'create' -- Block created via XML. 'cleanup' -- Workspace aligned top-level blocks. Event merging may create multiple reasons: ['drag', 'bump', 'snap']. | ||
EventType |
Methods
Method | Modifiers | Description |
|---|---|---|
Does this event record any change of state? | ||
Record the block's new location. Called after the move. | ||
Run a move event. | ||
Set the reason for a move event. | ||
Encode the event as JSON. |