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

TextEditor

Extends:

src/common/Component.js~Component → TextEditor

The TextEditor component displays a textarea with controls, including a submit button.

Attrs

  • composer
  • submitLabel
  • value
  • placeholder
  • disabled
  • preview

Member Summary

Public Members
public

Whether the editor is disabled.

public

The value of the editor.

Method Summary

Public Methods
public

buildEditor(dom: *): *

public

buildEditorParams(): {"classNames": *, "disabled": *, "placeholder": *, "value": *, "oninput": *, "inputListeners": *, "onsubmit": *}

public

Build an item list for the text editor controls.

public

oncreate(vnode: *)

public

oninit(vnode: *)

public

oninput(value: String)

Handle input into the textarea.

public

Handle the submit button being clicked.

public

onupdate(vnode: *)

public

Build an item list for the toolbar controls.

public

view(): *

Public Members

public disabled: * source

Whether the editor is disabled.

public value: String source

The value of the editor.

Public Methods

public buildEditor(dom: *): * source

Params:

NameTypeAttributeDescription
dom *

Return:

*

public buildEditorParams(): {"classNames": *, "disabled": *, "placeholder": *, "value": *, "oninput": *, "inputListeners": *, "onsubmit": *} source

Return:

{"classNames": *, "disabled": *, "placeholder": *, "value": *, "oninput": *, "inputListeners": *, "onsubmit": *}

public controlItems(): ItemList source

Build an item list for the text editor controls.

Return:

ItemList

public oncreate(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public oninit(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public oninput(value: String) source

Handle input into the textarea.

Params:

NameTypeAttributeDescription
value String

public onsubmit() source

Handle the submit button being clicked.

public onupdate(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public toolbarItems(): ItemList source

Build an item list for the toolbar controls.

Return:

ItemList

public view(): * source

Return:

*