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

ComposerBody

Extends:

flarum/Component~Component → ComposerBody

The ComposerBody component handles the body, or the content, of the composer. Subclasses should implement the onsubmit method and override headerTimes.

Props

  • originalContent
  • submitLabel
  • placeholder
  • user
  • confirmExit
  • disabled

Member Summary

Public Members
public

The content of the text editor.

public

The text editor component instance.

public

Whether or not the component is loading.

Method Summary

Public Methods
public

focus()

Draw focus to the text editor.

public

Build an item list for the composer's header.

public

init()

public

loaded()

Stop loading.

public abstract

Handle the submit event of the text editor.

public

Check if there is any unsaved data – if there is, return a confirmation message to prompt the user with.

public

view(): *

Public Members

public content: Function source

The content of the text editor.

public editor: TextEditor source

The text editor component instance.

public loading: Boolean source

Whether or not the component is loading.

Public Methods

public focus() source

Draw focus to the text editor.

public headerItems(): ItemList source

Build an item list for the composer's header.

Return:

ItemList

public init() source

public loaded() source

Stop loading.

public abstract onsubmit() source

Handle the submit event of the text editor.

public preventExit(): String source

Check if there is any unsaved data – if there is, return a confirmation message to prompt the user with.

Return:

String

public view(): * source

Return:

*