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

DiscussionPage

Extends:

src/common/Component.js~ComponentPage → DiscussionPage

The DiscussionPage component displays a whole discussion page, including the discussion list pane, the hero, the posts, and the sidebar.

Member Summary

Public Members
public
public

The discussion that is being viewed.

public

The number of the first post that is currently visible in the viewport.

public

stream: *

Method Summary

Public Methods
public

load()

Load the discussion from the API or use the preloaded one.

public

oninit(vnode: *)

public
public

positionChanged(startNumber: Integer, endNumber: Integer)

When the posts that are visible in the post stream change (i.e.

public

Get the parameters that should be passed in the API request to get the discussion.

public

show(discussion: Discussion)

Initialize the component to display the given discussion.

public

Build an item list for the contents of the sidebar.

public

view(): *

Inherited Summary

From class Page
public

A class name to apply to the body while the route is active.

public

Whether we should scroll to the top of the page when its rendered.

public

oncreate(vnode: *)

public

oninit(vnode: *)

public

Public Members

public bodyClass: string source

A class name to apply to the body while the route is active.

Override:

Page#bodyClass

public discussion: Discussion source

The discussion that is being viewed.

public near: number source

The number of the first post that is currently visible in the viewport.

public stream: * source

Public Methods

public load() source

Load the discussion from the API or use the preloaded one.

public oninit(vnode: *) source

Override:

Page#oninit

Params:

NameTypeAttributeDescription
vnode *

public onremove() source

Override:

Page#onremove

public positionChanged(startNumber: Integer, endNumber: Integer) source

When the posts that are visible in the post stream change (i.e. the user scrolls up or down), then we update the URL and mark the posts as read.

Params:

NameTypeAttributeDescription
startNumber Integer
endNumber Integer

public requestParams(): Object source

Get the parameters that should be passed in the API request to get the discussion.

Return:

Object

public show(discussion: Discussion) source

Initialize the component to display the given discussion.

Params:

NameTypeAttributeDescription
discussion Discussion

public sidebarItems(): ItemList source

Build an item list for the contents of the sidebar.

Return:

ItemList

public view(): * source

Return:

*