Reference Source
import GlobalSearchState from 'flarum/states/GlobalSearchState'
public class | source

GlobalSearchState

Extends:

SearchState → GlobalSearchState

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

value: *

Method Summary

Public Methods
public

Redirect to the index page using the given sort parameter.

public

clear()

Clear the search input and the current controller's active search.

public

Redirect to the index page without a search filter.

public

Return the current search query, if any.

public

getValue(): *

public

Get parameters to pass to the DiscussionList component.

public

Get URL parameters that stick between filter changes.

Inherited Summary

From class SearchState
public
public

value: *

public

cache(query: *)

Mark that we have already searched for this query so that we don't have to ping the endpoint again.

public

clear()

Clear the search value.

public

getValue(): *

public

isCached(query: *): *

Check if this query has been searched before.

public

setValue(value: *)

Public Constructors

public constructor() source

Override:

SearchState#constructor

Public Members

public searchRoute: * source

public value: * source

Override:

SearchState#value

Public Methods

public changeSort(sort: String) source

Redirect to the index page using the given sort parameter.

Params:

NameTypeAttributeDescription
sort String

public clear() source

Clear the search input and the current controller's active search.

Override:

SearchState#clear

public clearInitialSearch() 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 getInitialSearch(): String source

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

Return:

String

See:

public getValue(): * source

Override:

SearchState#getValue

Return:

*

public params(): Object source

Get parameters to pass to the DiscussionList component.

Return:

Object

public stickyParams(): Object source

Get URL parameters that stick between filter changes.

Return:

Object