Class: UiViewUtils
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiViewUtils.ts:6
A utility class for working with UI views.
Constructors
Constructor
new UiViewUtils():
UiViewUtils
Returns
UiViewUtils
Methods
alignPositionedPopupToElement()
static
alignPositionedPopupToElement(options
,container
,target
,popupReference
,alignTo
,xOffset
,yOffset
):UiPositionedPopupOpenOptions
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/UiSystem/UiViewUtils.ts:21
Sets the parameters of a positioned popup's opening options to align the popup with an element rendered in the same view stack container.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
options | UiPositionedPopupOpenOptions | undefined | The popup opening options for which to set parameters. |
container | HTMLElement | undefined | The root element of the popup's view stack container. |
target | HTMLElement | undefined | The target element to which to align the popup. |
popupReference | "top-left" | "top-right" | "bottom-left" | "bottom-right" | 'top-left' | The reference corner of the popup which will be aligned to the target element. Defaults to 'top-left' . |
alignTo | "top-left" | "top-right" | "bottom-left" | "bottom-right" | 'top-left' | The edges of the target element to which to align the popup. Defaults to 'top-left' . |
xOffset | number | 0 | The horizontal offset to apply to the popup's position after alignment, in pixels. |
yOffset | number | 0 | The vertical offset to apply to the popup's position after alignment, in pixels. |
Returns
The provided popup opening options, after its parameters have been set to align the popup in the specified manner.