mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Automatically mark invalid notifications as read upon request
Change-Id: I8f72daf1b49bcb42037c1415f806bab3472d8e39
This commit is contained in:
parent
ff53edda5b
commit
7637e1283d
|
@ -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 ) {
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue