Expand all

abstract mw.echo.ui.NotificationItemWidget

Extends

Constructor

new mw.echo.ui.NotificationItemWidget(controller, model, [config])abstract #

Parameters:

Name Type Attributes Description
controller mw.echo.Controller

Echo controller

model mw.echo.dm.NotificationItem

Notification item model

config Object optional

Configuration options

Source:
A base widget for displaying notification items.

Methods

destroy() #

Disconnect events when widget is destroyed.

Source:
Disconnect events when widget is destroyed.

getId() → {number} #

Get the notification Id

Source:

Returns:

Notification id

Type
number
Get the notification Id

getModel() → {mw.echo.dm.NotificationItem} #

Get the model associated with this widget.

Source:

Returns:

Item model

Type
mw.echo.dm.NotificationItem
Get the model associated with this widget.

getPrimaryUrl() → {string} #

Get the notification link

Source:

Returns:

Notification link

Type
string
Get the notification link

getTimestamp() → {number} #

Get the item id

Source:

Returns:

Notification id

Type
number
Get the item id

isFake() → {boolean} #

Declares whether this widget is a cloned fake.

Source:

Returns:

false

Type
boolean
Declares whether this widget is a cloned fake.

isForeign() → {boolean} #

Check whether this item is foreign.

Source:

Returns:

Item is foreign

Type
boolean
Check whether this item is foreign.

isRead() → {boolean} #

Check whether this item is read.

Source:

Returns:

Item is read

Type
boolean
Check whether this item is read.

isSeen() → {boolean} #

Check whether this item is seen.

Source:

Returns:

Item is seen

Type
boolean
Check whether this item is seen.

markRead([isRead])abstract #

Mark this notification as read

Parameters:

Name Type Attributes Default Description
isRead boolean optional
true

Notification is marked as read

Source:
Mark this notification as read

onMarkAsReadButtonClick() #

Respond to mark as read button click

Source:
Respond to mark as read button click

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

Source:
Manage a click on a dynamic secondary link.

onPrimaryLinkClick() → {boolean} #

Respond to primary link click. Override this in the descendents.

Source:

Returns:

true

Type
boolean
Respond to primary link click.

resetInitiallyUnseen() #

Remove the 'initiallyUnseen' class, which was only used for the unseen animation when the user has first seen it.

Source:

Remove the 'initiallyUnseen' class, which was only used for the unseen animation when the user has first seen it.

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

  • "false" means that the item is marked as read, whereby we show the user 'mark unread' buttons.
  • "true" means that the item is marked as unread and we show the user 'mark as read' buttons
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.

Source:
Toggle the read state of the widget

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.

Source:
Toggle the seen state of the widget