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

DiscussionPage

Extends:

flarum/components/Page~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

discussion: Discussion

The discussion that is being viewed.

public

near: Integer

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

public

stream: *

Method Summary

Public Methods
public

configPane(element: DOMElement, isInitialized: Boolean, context: Object)

Configure the discussion list pane.

public

init()

public

onunload(e: *)

public

positionChanged(startNumber: Integer, endNumber: Integer)

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

public

Clear and reload the discussion.

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

Public Members

public bodyClass: string source

public discussion: Discussion source

The discussion that is being viewed.

public near: Integer source

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

public stream: * source

Public Methods

public configPane(element: DOMElement, isInitialized: Boolean, context: Object) source

Configure the discussion list pane.

Params:

NameTypeAttributeDescription
element DOMElement
isInitialized Boolean
context Object

public init() source

public onunload(e: *) source

Params:

NameTypeAttributeDescription
e *

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 refresh() source

Clear and reload the discussion.

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:

*