Reference Source
import CommentPost from 'flarum/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

oninit(vnode: *)

public

onupdate(vnode: *)

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
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 oninit(vnode: *) source

Override:

Post#oninit

Params:

NameTypeAttributeDescription
vnode *

public onupdate(vnode: *) source

Override:

Post#onupdate

Params:

NameTypeAttributeDescription
vnode *

public toggleContent() source

Toggle the visibility of a hidden post's content.