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

ComposerPostPreview

Extends:

src/common/Component.js~Component → ComposerPostPreview

The ComposerPostPreview component renders Markdown as HTML using the TextFormatter library, polling a data source for changes every 50ms. This is done to prevent expensive redraws on e.g. every single keystroke, while still retaining the perception of live updates for the user.

Attrs

  • composer The state of the composer controlling this preview.
  • className A CSS class for the element surrounding the preview.
  • surround A callback that can execute code before and after re-render, e.g. for scroll anchoring.

Static Method Summary

Static Public Methods
public static

initAttrs(attrs: *)

Member Summary

Public Members
public

Method Summary

Public Methods
public

oncreate(vnode: *)

public

onremove(vnode: *)

public

view(): *

Static Public Methods

public static initAttrs(attrs: *) source

Params:

NameTypeAttributeDescription
attrs *

Public Members

public updateInterval: * source

Public Methods

public oncreate(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public onremove(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public view(): * source

Return:

*