DiscussionPage
Extends:
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 |
|
public |
Build an item list for the contents of the sidebar. |
|
public |
view(): * |
Public Members
public stream: * source
Public Methods
public hero(): import('mithril').Children source
Renders the discussion's hero.
Return:
import('mithril').Children |
public mainContent(): ItemList source
List of items rendered inside the main page content container.
public oninit(vnode: *) source
Params:
Name | Type | Attribute | Description |
vnode | * |
public onremove(vnode: *) source
Params:
Name | Type | Attribute | Description |
vnode | * |
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:
Name | Type | Attribute | Description |
startNumber | Integer | ||
endNumber | Integer |
public requestParams(): Object source
Get the parameters that should be passed in the API request to get the discussion.
public show(discussion: Discussion) source
Initialize the component to display the given discussion.
Params:
Name | Type | Attribute | Description |
discussion | Discussion |
public sidebar(): import('mithril').Children source
Function that renders the sidebarItems
ItemList.
Return:
import('mithril').Children |