Bsitu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/111681

Change subject: Automatically mark invalid notifications as read upon request
......................................................................

Automatically mark invalid notifications as read upon request

Change-Id: I8f72daf1b49bcb42037c1415f806bab3472d8e39
---
M modules/overlay/ext.echo.overlay.js
M special/SpecialNotifications.php
2 files changed, 12 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/81/111681/1

diff --git a/modules/overlay/ext.echo.overlay.js 
b/modules/overlay/ext.echo.overlay.js
index 1c3aff1..8161649 100644
--- a/modules/overlay/ext.echo.overlay.js
+++ b/modules/overlay/ext.echo.overlay.js
@@ -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;
                                        }
@@ -118,11 +124,6 @@
                                        $li.wrapInner( $wrapper );
 
                                        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.
diff --git a/special/SpecialNotifications.php b/special/SpecialNotifications.php
index 0f52f5c..067d090 100644
--- a/special/SpecialNotifications.php
+++ b/special/SpecialNotifications.php
@@ -59,6 +59,12 @@
                $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 @@
                                $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(

-- 
To view, visit https://gerrit.wikimedia.org/r/111681
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f72daf1b49bcb42037c1415f806bab3472d8e39
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to