Flarum (v2.0.0-beta.5)
    Preparing search index...

    Class used to manage modal state.

    Accessible on the app object via app.modal property.

    Index

    Constructors

    Properties

    backdropShown: boolean = false
    loadingModal: boolean = false
    modal: ModalItem | null = null
    modalList: ModalItem[] = []

    Methods

    • 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.

      Parameters

      Returns Promise<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);
      app.modal.show(MyCoolStackedModal, { attr: 'value' }, true);