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

Modal

Extends:

src/common/Component.js~Component → Modal

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

Static Member Summary

Static Public Members
public static

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

Member Summary

Public Members
public

Attributes for 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

loaded()

Stop loading.

public
public

oncreate(vnode: *)

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(): *

Static Public Members

public static isDismissible: * source

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

Public Members

public alertAttrs: object source

Attributes for 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 loaded() source

Stop loading.

public onbeforeremove(): * source

Return:

*

public oncreate(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

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:

*