Constructor

Trashcan

new Trashcan(workspace)

Class for a trash can.

Parameter

workspace

Blockly.Workspace

The workspace to sit in.

Value must not be null.

Property

isOpen

boolean

Current open/close state of the lid.

Methods

click

click()

Inspect the contents of the trash.

close

close()

Flip the lid shut. Called externally after a drag.

createDom

createDom() returns Element

Create the trash can elements.

Returns

non-null Element The trash can's SVG group.

dispose

dispose()

Dispose of this trash can. Unlink from all DOM elements to prevent memory leaks.

getClientRect

getClientRect() returns Blockly.utils.Rect

Return the deletion rectangle for this trash can.

Returns

Blockly.utils.Rect Rectangle in which to delete.

init

init(verticalSpacing) returns number

Initialize the trash can.

Parameter

verticalSpacing

number

Vertical distance from workspace edge to the same edge of the trashcan.

Returns

number Vertical distance from workspace edge to the opposite edge of the trashcan.

position

position()

Position the trashcan. It is positioned in the opposite corner to the corner the categories/toolbox starts at.