Automatically mark invalid notifications as read upon request

Change-Id: I8f72daf1b49bcb42037c1415f806bab3472d8e39
This commit is contained in:
bsitu 2014-02-05 16:53:04 -08:00
parent ff53edda5b
commit 7637e1283d
2 changed files with 12 additions and 10 deletions

View file

@ -80,6 +80,12 @@
'data-notification-type': data.type
} )
.addClass( 'mw-echo-notification' );
if ( !data.read ) {
$li.addClass( 'mw-echo-unread' );
unread.push( id );
}
if ( !data['*'] ) {
return;
}
@ -119,11 +125,6 @@
mw.echo.setupNotificationLogging( $li, 'flyout' );
if ( !data.read ) {
$li.addClass( 'mw-echo-unread' );
unread.push( id );
}
// Set up each individual notification with a close box and dismiss
// interface if it is dismissable.
if ( $li.find( '.mw-echo-dismiss' ).length ) {

View file

@ -59,6 +59,12 @@ class SpecialNotifications extends SpecialPage {
$notices = '';
$unread = array();
foreach ( $notif as $row ) {
$class = 'mw-echo-notification';
if ( !isset( $row['read'] ) ) {
$class .= ' mw-echo-unread';
$unread[] = $row['id'];
}
if ( !$row['*'] ) {
continue;
}
@ -68,11 +74,6 @@ class SpecialNotifications extends SpecialPage {
$notices .= Html::rawElement( 'li', array( 'class' => 'mw-echo-date-section' ), $dateHeader );
}
$class = 'mw-echo-notification';
if ( !isset( $row['read'] ) ) {
$class .= ' mw-echo-unread';
$unread[] = $row['id'];
}
$notices .= Html::rawElement(
'li',
array(