Expand all

mw.echo.ui.DatedSubGroupListWidget

Extends

Constructor

new mw.echo.ui.DatedSubGroupListWidget(controller, listModel, [config]) #

A sub group widget that displays notifications divided by dates.

Parameters:

Name Type Attributes Description
controller mw.echo.Controller

Notifications controller

listModel mw.echo.dm.SortedList

Notifications list model for this source

config Object optional

Configuration object

Source:
A sub group widget that displays notifications divided by dates.

Methods

destroy() #

Destroy the widget and disconnect events

Inherited from:
Source:
Destroy the widget and disconnect events

getAllItemIDs() → {Array.<number>} #

Get an array of IDs of all of the items in this group

Inherited from:
Source:

Returns:

Array of item IDs

Type
Array.<number>
Get an array of IDs of all of the items in this group

getAllItemIDsByType(type) → {Array.<number>} #

Get an array of IDs of all of the items in this group that correspond to a specific type

Parameters:

Name Type Description
type string

Item type

Inherited from:
Source:

Returns:

Array of item IDs

Type
Array.<number>

Get an array of IDs of all of the items in this group that correspond to a specific type

getId() → {string} #

Get the group id, which is represented by its model symbolic name. This is meant for sorting callbacks that fallback on sorting by IDs.

Inherited from:
Source:

Returns:

Group source

Type
string
Get the group id, which is represented by its model symbolic name.

getListWidget() → {mw.echo.ui.SortedListWidget} #

Get the associated list widget. This is useful to specifically add and/or remove items from the list.

Inherited from:
Source:

Returns:

List widget

Type
mw.echo.ui.SortedListWidget
Get the associated list widget.

getSource() → {string} #

Get a the source of this list.

Inherited from:
Source:

Returns:

Group source

Type
string
Get a the source of this list.

getTimestamp() → {number} #

Get the timestamp for the list

Inherited from:
Source:

Returns:

Timestamp

Type
number
Get the timestamp for the list

hasUnread() → {boolean} #

Check whether this sub group list has any unread notifications

Inherited from:
Source:

Returns:

Sub group has unread notifications

Type
boolean
Check whether this sub group list has any unread notifications

isForeign() → {boolean} #

Check whether this group is foreign

Inherited from:
Source:

Returns:

This group is foreign

Type
boolean
Check whether this group is foreign

onMarkAllReadButtonClick() #

Respond to 'mark all as read' button click

Inherited from:
Source:
Respond to 'mark all as read' button click

onModelDiscardItems(items) #

Respond to model remove event. This may happen when an item is marked as read.

Parameters:

Name Type Description
items Array.<mw.echo.dm.NotificationItem>

Notification item models

Inherited from:
Source:
Respond to model remove event.

resetItemsFromModel([items]) #

Reset the items and rebuild them according to the model.

Parameters:

Name Type Attributes Description
items Array.<mw.echo.dm.NotificationItem> optional

Item models that are added. If this is empty, the widget will request all the items from the model.

Inherited from:
Source:
Reset the items and rebuild them according to the model.

resizeHeader() #

Respond to window resize event

Inherited from:
Source:
Respond to window resize event

toggleMarkAllReadButton() #

Toggle the visibility of the mark all read button for this group based on whether there are unread notifications

Inherited from:
Source:

Toggle the visibility of the mark all read button for this group based on whether there are unread notifications

toggleTitle(show) #

Toggle the visibility of the title

Parameters:

Name Type Description
show boolean

Show the title

Inherited from:
Source:
Toggle the visibility of the title