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

CommentPost

Extends:

src/common/Component.js~ComponentPost → CommentPost

The CommentPost component displays a standard comment-typed post. This includes a number of item lists (controls, header, and footer) surrounding the post's HTML content.

Attrs

  • post

Member Summary

Public Members
public

Whether or not the user hover card inside of PostUser is visible.

public
public

If the post has been hidden, then this flag determines whether or not its content has been expanded.

Method Summary

Public Methods
public

content(): *

public
public

Build an item list for the post's header.

public

isEditing(): *

public

oncreate(vnode: *)

public

oninit(vnode: *)

public

onupdate(vnode: *)

public
public

Toggle the visibility of a hidden post's content.

Inherited Summary

From class Post
public
public

Set up a subtree retainer so that the post will not be redrawn unless new data comes in.

public

Build an item list for the post's actions.

public

classes(string: *): string[]

Get the post's classes.

public

Get the post's content.

public

Get attributes for the post element.

public

Build an item list for the post's footer.

public

onbeforeupdate(vnode: *): *

public

oninit(vnode: *)

public

onupdate(vnode: *)

public

view(): *

Public Members

public cardVisible: Boolean source

Whether or not the user hover card inside of PostUser is visible. The property must be managed in CommentPost to be able to use it in the subtree check

public contentHtml: * source

public revealContent: Boolean source

If the post has been hidden, then this flag determines whether or not its content has been expanded.

Public Methods

public content(): * source

Get the post's content.

Override:

Post#content

Return:

*

public elementAttrs(): * source

Get attributes for the post element.

Override:

Post#elementAttrs

Return:

*

public headerItems(): ItemList source

Build an item list for the post's header.

Return:

ItemList

public isEditing(): * source

Return:

*

public oncreate(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public oninit(vnode: *) source

Override:

Post#oninit

Params:

NameTypeAttributeDescription
vnode *

public onupdate(vnode: *) source

Override:

Post#onupdate

Params:

NameTypeAttributeDescription
vnode *

public refreshContent() source

public toggleContent() source

Toggle the visibility of a hidden post's content.