Flarum (v1.3.1)
    Preparing search index...

    Class used to manage modal state.

    Accessible on the app object via app.modal property.

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

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

    Methods

    • Shows a modal dialog.

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

      Parameters

      Returns void

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