Extends
Constructor
new mw.echo.ui.NotificationBadgeWidget(controller, manager, links, config)
#
Notification badge button widget for echo popup.
Parameters:
Name | Type | Description |
---|---|---|
controller |
mw.echo.Controller | Echo notifications controller |
manager |
mw.echo.dm.ModelManager | Model manager |
links |
Object | Links object, containing 'notifications' and 'preferences' URLs |
config |
Object | Configuration object |
Methods
onBadgeButtonClick()
#
Respond to badge button click
onMarkAllReadButtonClick()
#
Respond to 'mark all as read' button click
onNotificationsListModified()
#
Respond to list widget modified event.
This means the list's actual DOM was modified and we should make sure that the popup resizes itself.
onPopupToggle(isVisible)
#
Extend the response to button click so we can also update the notification list.
Parameters:
Name | Type | Description |
---|---|---|
isVisible |
boolean | The popup is visible |
Fires:
onSeenTimeModelUpdate()
#
Respond to SeenTime model update event
updateBadge()
#
Update the badge state and label based on changes to the model
updateBadgeSeenState([hasUnseen])
#
Update the badge style to match whether it contains unseen notifications.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
hasUnseen |
boolean |
optional |
false | There are unseen notifications |
Events
allRead()
#
All notifications were marked as read
finishLoading()
#
Notifications have successfully finished being processed and are fully loaded