blockly > SeparatorFlyoutInflater > load
SeparatorFlyoutInflater.load() method
Inflates a dummy flyout separator.
The flyout automatically creates separators between every element with a size determined by calling gapForElement on the relevant inflater. Additionally, users can explicitly add separators in the flyout definition. When separators (implicitly or explicitly created) follow one another, the gap of the last one propagates backwards and flattens to one separator. This flattening is not additive; if there are initially separators of 2, 3, and 4 pixels, after normalization there will be one separator of 4 pixels. Therefore, this method returns a zero-width separator, which will be replaced by the one implicitly created by the flyout based on the value returned by gapForElement, which knows the default gap, unlike this method.
Signature:
load(_state: object, flyout: IFlyout): FlyoutItem;
Parameters
Parameter | Type | Description |
---|---|---|
_state | object | A JSON representation of a flyout separator. |
flyout | IFlyout | The flyout to create the separator for. |
Returns:
A newly created FlyoutSeparator.