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

IndexPage

Extends:

flarum/components/Page~Page → IndexPage

The IndexPage component displays the index page, including the welcome hero, the sidebar, and the discussion list.

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

Build an item list for the part of the toolbar which is about taking action on the results.

public

Redirect to the index page using the given sort parameter.

public

Redirect to the index page without a search filter.

public

composeNewDiscussion(deferred: Deferred): Promise

Initialize the composer for a new discussion.

public

config(isInitialized: *, context: *)

public

hero(): MithrilComponent

Get the component to display as the hero.

public

init()

public

Mark all discussions as read.

public

Build an item list for the navigation in the sidebar of the index page.

public

Log the user in and then open the composer for a new discussion.

public
public

Get parameters to pass to the DiscussionList component.

public

Return the current search query, if any.

public

Build an item list for the sidebar of the index page.

public

Get URL parameters that stick between filter changes.

public

view(): *

public

Build an item list for the part of the toolbar which is concerned with how the results are displayed.

Public Members

public bodyClass: string source

public lastDiscussion: * source

Public Methods

public actionItems(): ItemList source

Build an item list for the part of the toolbar which is about taking action on the results. By default this is just a "mark all as read" button.

Return:

ItemList

public changeSort(sort: String) source

Redirect to the index page using the given sort parameter.

Params:

NameTypeAttributeDescription
sort String

public clearSearch() source

Redirect to the index page without a search filter. This is called when the 'x' is clicked in the search box in the header.

See:

public composeNewDiscussion(deferred: Deferred): Promise source

Initialize the composer for a new discussion.

Params:

NameTypeAttributeDescription
deferred Deferred

Return:

Promise

public config(isInitialized: *, context: *) source

Params:

NameTypeAttributeDescription
isInitialized *
context *

public hero(): MithrilComponent source

Get the component to display as the hero.

Return:

MithrilComponent

public init() source

public markAllAsRead(): * source

Mark all discussions as read.

Return:

*

void

public navItems(): ItemList source

Build an item list for the navigation in the sidebar of the index page. By default this is just the 'All Discussions' link.

Return:

ItemList

public newDiscussion(): Promise source

Log the user in and then open the composer for a new discussion.

Return:

Promise

public onunload() source

public params(): Object source

Get parameters to pass to the DiscussionList component.

Return:

Object

public searching(): String source

Return the current search query, if any. This is implemented to activate the search box in the header.

Return:

String

See:

public sidebarItems(): ItemList source

Build an item list for the sidebar of the index page. By default this is a "New Discussion" button, and then a DropdownSelect component containing a list of navigation items.

Return:

ItemList

public stickyParams(): Object source

Get URL parameters that stick between filter changes.

Return:

Object

public view(): * source

Return:

*

public viewItems(): ItemList source

Build an item list for the part of the toolbar which is concerned with how the results are displayed. By default this is just a select box to change the way discussions are sorted.

Return:

ItemList