Extends
Constructor
new mw.echo.ui.BundleNotificationItemWidget(controller, model, [config])
#
Bundle notification item widget. This widget is expandable and displays inner notifications that constitute the bundle.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
controller |
mw.echo.Controller | Echo notifications controller |
|
model |
mw.echo.dm.BundleNotificationItem | Notification group model |
|
config |
Object |
optional |
Configuration object |
Methods
destroy()
#
Disconnect events when widget is destroyed.
- Inherited from:
- Source:
expand()
#
Expand the group and fetch the list of notifications. Only fetch the first time we expand.
getId() → {number}
#
Get the notification Id
- Inherited from:
- Source:
Returns:
Notification id
- Type
- number
getList() → {mw.echo.ui.SortedListWidget}
#
Get the list widget contained in this item
Returns:
List widget
getModel() → {mw.echo.dm.NotificationItem}
#
Get the model associated with this widget.
- Inherited from:
- Source:
Returns:
Item model
getPrimaryUrl() → {string}
#
Get the notification link
- Inherited from:
- Source:
Returns:
Notification link
- Type
- string
getTimestamp() → {number}
#
Get the item id
- Inherited from:
- Source:
Returns:
Notification id
- Type
- number
isFake() → {boolean}
#
Declares whether this widget is a cloned fake.
- Inherited from:
- Source:
Returns:
false
- Type
- boolean
isForeign() → {boolean}
#
Check whether this item is foreign.
- Inherited from:
- Source:
Returns:
Item is foreign
- Type
- boolean
isRead() → {boolean}
#
Check whether this item is read.
- Inherited from:
- Source:
Returns:
Item is read
- Type
- boolean
isSeen() → {boolean}
#
Check whether this item is seen.
- Inherited from:
- Source:
Returns:
Item is seen
- Type
- boolean
markRead([isRead])
#
Mark this notification as read
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
isRead |
boolean |
optional |
true | Notification is marked as read |
onMarkAsReadButtonClick()
#
Respond to mark as read button click
- Inherited from:
- Source:
onPopupButtonWidgetChoose(item)
#
Manage a click on a dynamic secondary link. We can't know what the link intends us to do in the API, so we trust the 'apiParams' to tell the controller. When the link is clicked, we will pass the information on to the controller, which will manage whatever promise and action is needed.
NOTE: The messages are parsed as HTML. If user-input is expected please make sure to properly escape it.
Parameters:
Name | Type | Description |
---|---|---|
item |
OO.ui.ButtonOptionWidget | The selected item |
- Inherited from:
- Source:
onPrimaryLinkClick() → {boolean}
#
Respond to primary link click. Override this in the descendents.
- Inherited from:
- Source:
Returns:
true
- Type
- boolean
populateFromModel()
#
Populate the items in this widget according to the data in the model
Populate the items in this widget according to the data in the model
resetInitiallyUnseen()
#
Remove the 'initiallyUnseen' class, which was only used for the unseen animation when the user has first seen it.
- Inherited from:
- Source:
Remove the 'initiallyUnseen' class, which was only used for the unseen animation when the user has first seen it.
toggleExpanded(show)
#
Toggle the expand/collapsed state of this group widget
Parameters:
Name | Type | Description |
---|---|---|
show |
boolean | Show the widget expanded |
toggleListDisplay(showList)
#
Toggle the visibility of the notification item list and the placeholder/error widget.
Parameters:
Name | Type | Description |
---|---|---|
showList |
boolean | Show the list |
toggleMarkAsReadButtons([showMarkAsRead])
#
Toggle the function of the 'mark as read' buttons from 'mark as read' to 'mark as unread' and vice versa.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
showMarkAsRead |
boolean |
optional |
Show the 'mark as read' buttons
|
- Inherited from:
- Source:
Toggle the function of the 'mark as read' buttons from 'mark as read' to 'mark as unread' and vice versa.
toggleRead([read])
#
Toggle the read state of the widget
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
read |
boolean |
optional |
The current read state. If not given, the state will become the opposite of its current state. |
- Inherited from:
- Source:
toggleSeen([seen])
#
Toggle the seen state of the widget
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
seen |
boolean |
optional |
The current seen state. If not given, the state will become the opposite of its current state. |
- Inherited from:
- Source:
updateDataFromModel()
#
Update item state when the item model changes.
Fires:
updateExpandButton()
#
Update the expand button label