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 goog.math.Rect

Return the deletion rectangle for this trash can.

Returns

goog.math.Rect Rectangle in which to delete.

init

init(bottom) returns number

Initialize the trash can.

Parameter

bottom

number

Distance from workspace bottom to bottom of trashcan.

Returns

number Distance from workspace bottom to the top of trashcan.

position

position()

Move the trash can to the bottom-right corner.