Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to manage modal state.

Accessible on the app object via app.modal property.

Hierarchy

  • ModalManagerState

Index

Constructors

constructor

Properties

Private Optional closeTimeout

closeTimeout?: Timeout

Private key

key: number = 0

Used to force re-initialization of modals if a modal is replaced by another of the same type.

modal

modal: null | { attrs?: Record<string, unknown>; componentClass: UnsafeModalClass; key: number } = null
internal

Methods

close

  • close(): void

isModalOpen

  • isModalOpen(): boolean

show

  • Shows a modal dialog.

    If a modal is already open, the existing one will close and the new modal will replace it.

    example

    Show a modal app.modal.show(MyCoolModal, { attr: 'value' });

    example

    Show a modal from a lifecycle method (oncreate, view, etc.) // This "hack" is needed due to quirks with nested redraws in Mithril. setTimeout(() => app.modal.show(MyCoolModal, { attr: 'value' }), 0);

    Parameters

    Returns void

Generated using TypeDoc version 0.22.10