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

backdropShown

backdropShown: boolean = false
internal

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 | ModalItem = null
internal

modalList

modalList: ModalItem[] = []
internal

Methods

close

  • close(): void

isModalOpen

  • isModalOpen(): boolean

show

  • show(componentClass: UnsafeModalClass, attrs?: Record<string, unknown>, stackModal?: boolean): void
  • Shows a modal dialog.

    If stackModal is true, the modal will be shown on top of the current modal.

    If a value for stackModal is not provided, opening a new modal will close any others currently being shown for backwards compatibility.

    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);

    example

    Stacking modals app.modal.show(MyCoolStackedModal, { attr: 'value' }, true);

    Parameters

    • componentClass: UnsafeModalClass
    • attrs: Record<string, unknown> = {}
    • stackModal: boolean = false

    Returns void

Generated using TypeDoc version 0.22.10