Skip to main content

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​

ParameterTypeDefault valueDescription
optionsUiPositionedPopupOpenOptionsundefinedThe popup opening options for which to set parameters.
containerHTMLElementundefinedThe root element of the popup's view stack container.
targetHTMLElementundefinedThe target element to which to align the popup.
popupReference"top-right" | "bottom-left" | "bottom-right" | "top-left"'top-left'The reference corner of the popup which will be aligned to the target element. Defaults to 'top-left'.
alignTo"top-right" | "bottom-left" | "bottom-right" | "top-left"'top-left'The edges of the target element to which to align the popup. Defaults to 'top-left'.
xOffsetnumber0The horizontal offset to apply to the popup's position after alignment, in pixels.
yOffsetnumber0The vertical offset to apply to the popup's position after alignment, in pixels.

Returns​

UiPositionedPopupOpenOptions

The provided popup opening options, after its parameters have been set to align the popup in the specified manner.