Slide 51
Slide 51 text
mw.echo.ui.NotificationItemWidget = function( model, config ) {
this.model = model;
this.markAsReadButton = new OO.ui.ButtonWidget( {
icon: 'close',
framed: false,
classes: [ 'mw-echo-ui-notificationItemWidget-markAsReadButton' ]
} );
// Events
this.markAsReadButton.connect( this, { click: 'onMarkAsReadButtonClick' } );
this.model.connect( this, {
seen: 'onModelSeen',
read: 'onModelRead'
} );
/* … */
}
mw.echo.ui.NotificationItemWidget.prototype.onMarkAsReadButtonClick = function () {
this.model.toggleRead( true );
};