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

NotificationGrid

Extends:

flarum/Component~Component → NotificationGrid

The NotificationGrid component displays a table of notification types and methods, allowing the user to toggle each combination.

Props

  • user

Member Summary

Public Members
public

A map of notification type-method combinations to the checkbox instances that represent them.

public

Information about the available notification methods.

public

Information about the available notification types.

Method Summary

Public Methods
public

config(isInitialized: *)

public

init()

public

Build an item list for the notification types to display in the grid.

public

preferenceKey(type: String, method: String): String

Get the name of the preference key for the given notification type-method combination.

public

toggle(keys: Array)

Toggle the state of the given preferences, based on the value of the first one.

public

toggleMethod(method: String)

Toggle all notification types for the given method.

public

Toggle all notification methods for the given type.

public

view(): *

Public Members

public inputs: Object source

A map of notification type-method combinations to the checkbox instances that represent them.

public methods: Array source

Information about the available notification methods.

public types: Object source

Information about the available notification types.

Public Methods

public config(isInitialized: *) source

Params:

NameTypeAttributeDescription
isInitialized *

public init() source

public notificationTypes(): ItemList source

Build an item list for the notification types to display in the grid.

Each notification type is an object which has the following properties:

  • name The name of the notification type.
  • label The label to display in the notification grid row.

Return:

ItemList

public preferenceKey(type: String, method: String): String source

Get the name of the preference key for the given notification type-method combination.

Params:

NameTypeAttributeDescription
type String
method String

Return:

String

public toggle(keys: Array) source

Toggle the state of the given preferences, based on the value of the first one.

Params:

NameTypeAttributeDescription
keys Array

public toggleMethod(method: String) source

Toggle all notification types for the given method.

Params:

NameTypeAttributeDescription
method String

public toggleType(type: String) source

Toggle all notification methods for the given type.

Params:

NameTypeAttributeDescription
type String

public view(): * source

Return:

*