Skip to content

calculatePopupPosition()

@blobs/sdk v0.1.0


@blobs/sdk / sso / calculatePopupPosition

calculatePopupPosition(width, height): object

Defined in: sso/SSOConfig.ts:49

Computes the screen coordinates needed to center a popup of the given size.

Reads the parent window’s screenLeft/screenTop and viewport size so the popup ends up centered over whichever monitor the parent is on.

Parameters

width

number

Popup width in pixels.

height

number

Popup height in pixels.

Returns

object

Absolute {left, top} coordinates for window.open.

left

left: number

top

top: number