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 |
Methods
destroy()
#
Destroy the widget and disconnect events
- Inherited from:
- Source:
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>
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
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
getSource() → {string}
#
Get a the source of this list.
- Inherited from:
- Source:
Returns:
Group source
- Type
- string
getTimestamp() → {number}
#
Get the timestamp for the list
- Inherited from:
- Source:
Returns:
Timestamp
- Type
- number
hasUnread() → {boolean}
#
Check whether this sub group list has any unread notifications
- Inherited from:
- Source:
Returns:
Sub group has unread notifications
- Type
- boolean
isForeign() → {boolean}
#
Check whether this group is foreign
- Inherited from:
- Source:
Returns:
This group is foreign
- Type
- boolean
onMarkAllReadButtonClick()
#
Respond to 'mark all as read' button click
- Inherited from:
- Source:
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:
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:
resizeHeader()
#
Respond to window resize event
- Inherited from:
- Source:
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: