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

NotificationGrid

Extends:

src/common/Component.js~Component → NotificationGrid

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

Attrs

  • user

Member Summary

Public Members
public

A map of which notification checkboxes are loading.

public

Information about the available notification methods.

public

Information about the available notification types.

Method Summary

Public Methods
public

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

public

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

public

oncreate(vnode: *)

public

oninit(vnode: *)

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 loading: Object source

A map of which notification checkboxes are loading.

public methods: Array source

Information about the available notification methods.

public types: Array source

Information about the available notification types.

Public Methods

public notificationMethods(): ItemList source

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

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

  • name The name of the notification method.
  • icon The icon to display in the column header.
  • label The label to display in the column header.

Return:

ItemList

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.
  • icon The icon to display in the notification grid row.
  • label The label to display in the notification grid row.

Return:

ItemList

public oncreate(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public oninit(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

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:

*