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.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

An alert component to show below the header.

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

handleErrors(response: Object)

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

public

hide()

Hide the modal.

public

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

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 Constructors

public constructor() source

Public Members

public alert: Alert source

An alert component to show below the header.

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 handleErrors(response: Object) source

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

Params:

NameTypeAttributeDescription
response Object

public hide() source

Hide the modal.

public isDismissible(): Boolean source

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

Return:

Boolean

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:

*