Skip to content

Class ModalsManager

Source: modalsManager.ts

Manages the opening, closing and ordering of modals

Accessors

modalIds

Get Signature

get modalIds(): string[]

Returns the IDs of all open modals

Returns

string[]

Constructors

Constructor

new ModalsManager(): ModalsManager

Returns

ModalsManager

Methods

close()

close(modalId: string | number, sendModalsUpdate: boolean): void

Closes a modal

Parameters

modalId

The ID of the modal to close

string | number

sendModalsUpdate

boolean = true

Returns

void


focus()

focus(modalId: string): void

Brings a modal into focus

Parameters

modalId

string

The ID of the modal to bring into focus

Returns

void


getModalIconUrl()

static getModalIconUrl(name: string): string

Parameters

name

string

Returns

string


open()

open(modal: Modal, single: boolean): void

Opens a modal

Parameters

Modal

single

boolean = true

Set to false to preserve other open modals

Returns

void


setUpdateModals()

setUpdateModals(updateModals: (modals: Record<string, Modal>) => void): void

Parameters

updateModals

(modals: Record<string, Modal>) => void

Returns

void

Properties

containerRef?

optional containerRef: MutableRefObject<HTMLElement>


modals

modals: Record<string, Modal> = {}

Maps every modal ID to the corresponding modal


updateModals()

updateModals: (modals: Record<string, Modal>) => void

Function that handles changes to modals

Parameters

modals

Record<string, Modal>

Returns

void

Built by Prozilla