Blockly. WidgetDiv
Property
DIV
non-null Element
The HTML container for popup overlays (e.g. editor widgets).
Methods
createDom
createDom()
Create the widget div and inject it onto the page.
hide
hide()
Destroy the widget and hide the div.
hideIfOwner
hideIfOwner(oldOwner)
Destroy the widget and hide the div if it is being used by the specified object.
Parameter |
|
---|---|
oldOwner |
Object The object that was using this container. Value must not be null. |
isVisible
isVisible() returns boolean
Is the container visible?
- Returns
-
boolean
True if visible.
positionWithAnchor
positionWithAnchor(viewportBBox, anchorBBox, widgetSize, rtl)
Position the widget div based on an anchor rectangle. The widget should be placed adjacent to but not overlapping the anchor rectangle. The preferred position is directly below and aligned to the left (LTR) or right (RTL) side of the anchor.
Parameter |
|
---|---|
viewportBBox |
The bounding rectangle of the current viewport, in window coordinates. Value must not be null. |
anchorBBox |
The bounding rectangle of the anchor, in window coordinates. Value must not be null. |
widgetSize |
The size of the widget that is inside the widget div, in window coordinates. Value must not be null. |
rtl |
boolean Whether the workspace is in RTL mode. This determines horizontal alignment. |
show
show(newOwner, rtl, dispose)
Initialize and display the widget div. Close the old one if needed.
Parameter |
|
---|---|
newOwner |
Object The object that will be using this container. Value must not be null. |
rtl |
boolean Right-to-left (true) or left-to-right (false). |
dispose |
function() Optional cleanup function to be run when the widget is closed. |