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

DiscussionPage

Extends:

src/common/components/Page.js~Page → 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: *

public

Method Summary

Public Methods
public

hero(): import('mithril').Children

Renders the discussion's hero.

public

load()

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

public

List of components shown while the discussion is loading.

public

List of items rendered inside the main page content container.

public

oninit(vnode: *)

public

onremove(vnode: *)

public

List of items rendered as the main page content.

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

sidebar(): import('mithril').Children

Function that renders the sidebarItems ItemList.

public

Build an item list for the contents of the sidebar.

public

view(): *

Public Members

public bodyClass: string source

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 useBrowserScrollRestoration: boolean source

Public Methods

public hero(): import('mithril').Children source

Renders the discussion's hero.

Return:

import('mithril').Children

public load() source

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

public loadingItems(): ItemList source

List of components shown while the discussion is loading.

Return:

ItemList

public mainContent(): ItemList source

List of items rendered inside the main page content container.

Return:

ItemList

public oninit(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public onremove(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public pageContent(): ItemList source

List of items rendered as the main page content.

Return:

ItemList

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 sidebar(): import('mithril').Children source

Function that renders the sidebarItems ItemList.

Return:

import('mithril').Children

public sidebarItems(): ItemList source

Build an item list for the contents of the sidebar.

Return:

ItemList

public view(): * source

Return:

*