Reference Source
import Modal from 'flarum/components/Modal.js'
public class | source

Modal

Extends:

flarum/Component~Component → Modal

The Modal component displays a modal dialog, wrapped in a form. Subclasses should implement the className, title, and content methods.

Member Summary

Public Members
public

An alert component to show below the header.

public

Method Summary

Public Methods
public abstract

Get the class name to apply to the modal.

public abstract

content(): VirtualElement

Get the content of the modal.

public

hide()

Hide the modal.

public

init()

public

Determine whether or not the modal should be dismissible via an 'x' button.

public

loaded()

Stop loading.

public

Show an alert describing an error returned from the API, and give focus to the first relevant field.

public

Focus on the first input when the modal is ready to be used.

public

onsubmit(e: Event)

Handle the modal form's submit event.

public abstract

Get the title of the modal dialog.

public

view(): *

Public Members

public alert: Alert source

An alert component to show below the header.

public loading: boolean source

Public Methods

public abstract className(): String source

Get the class name to apply to the modal.

Return:

String

public abstract content(): VirtualElement source

Get the content of the modal.

Return:

VirtualElement

public hide() source

Hide the modal.

public init() source

public isDismissible(): Boolean source

Determine whether or not the modal should be dismissible via an 'x' button.

Return:

Boolean

public loaded() source

Stop loading.

public onerror(error: RequestError) source

Show an alert describing an error returned from the API, and give focus to the first relevant field.

Params:

NameTypeAttributeDescription
error RequestError

public onready() source

Focus on the first input when the modal is ready to be used.

public onsubmit(e: Event) source

Handle the modal form's submit event.

Params:

NameTypeAttributeDescription
e Event

public abstract title(): String source

Get the title of the modal dialog.

Return:

String

public view(): * source

Return:

*