jenkins-bot has submitted this change and it was merged.

Change subject: Remove initiallyUnseen before marking item read/unread
......................................................................


Remove initiallyUnseen before marking item read/unread

If we are marking the item as read/unread, we don't want the change
in class to trigger the unseen animation. When that happens, first
remove the 'initiallyUnseen' class (that triggers the animation)
and only then mark the item as read or unread.

Bug: T138522
Change-Id: I05e02518feb1fc166297594053a084718dcb7194
---
M modules/ui/mw.echo.ui.NotificationItemWidget.js
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ui/mw.echo.ui.NotificationItemWidget.js 
b/modules/ui/mw.echo.ui.NotificationItemWidget.js
index c515301..3a06221 100644
--- a/modules/ui/mw.echo.ui.NotificationItemWidget.js
+++ b/modules/ui/mw.echo.ui.NotificationItemWidget.js
@@ -211,6 +211,9 @@
                var action = item && item.getData();
 
                if ( action === 'toggleRead' ) {
+                       // If we're marking read or unread, the notification 
was already seen.
+                       // Remove the animation class
+                       this.$element.removeClass( 
'mw-echo-ui-notificationItemWidget-initiallyUnseen' );
                        this.markRead( !this.model.isRead() );
                }
        };
@@ -219,6 +222,9 @@
         * Respond to mark as read button click
         */
        mw.echo.ui.NotificationItemWidget.prototype.onMarkAsReadButtonClick = 
function () {
+               // If we're marking read or unread, the notification was 
already seen.
+               // Remove the animation class
+               this.$element.removeClass( 
'mw-echo-ui-notificationItemWidget-initiallyUnseen' );
                this.markRead( !this.model.isRead() );
        };
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I05e02518feb1fc166297594053a084718dcb7194
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to