mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-09-23 18:30:06 +00:00
Remove talk page notification bar if all messages are read
Bug: T106033 Change-Id: I5133896c204be701e0fae582af91c906175f39d1
This commit is contained in:
parent
60f97aff09
commit
8bc0c98b6f
|
@ -57,6 +57,11 @@
|
|||
mw.echo.ui.messageWidget.badgeButton.debouncedUpdateThemeClasses();
|
||||
// Replace the link button with the ooui button
|
||||
$existingMessageLink.parent().replaceWith( mw.echo.ui.messageWidget.$element );
|
||||
|
||||
mw.echo.ui.messageWidget.getModel().on( 'allRead', function () {
|
||||
// If there was a talk page notification, get rid of it
|
||||
$( '#pt-mytalk' ).detach();
|
||||
} );
|
||||
}
|
||||
|
||||
// Load alerts popup and button
|
||||
|
|
|
@ -162,6 +162,13 @@
|
|||
|
||||
mw.echo.ui.NotificationBadgeWidget.static.tagName = 'li';
|
||||
|
||||
/* Events */
|
||||
|
||||
/**
|
||||
* @event allRead
|
||||
* All notifications were marked as read
|
||||
*/
|
||||
|
||||
/* Methods */
|
||||
|
||||
/**
|
||||
|
|
|
@ -74,6 +74,12 @@
|
|||
* Items' read status has changed
|
||||
*/
|
||||
|
||||
/**
|
||||
* @event allRead
|
||||
*
|
||||
* All items are marked as read
|
||||
*/
|
||||
|
||||
/* Methods */
|
||||
|
||||
/**
|
||||
|
@ -117,6 +123,10 @@
|
|||
}
|
||||
this.emit( 'unreadChange', this.unreadNotifications.getItems() );
|
||||
}
|
||||
|
||||
if ( this.unreadNotifications.isEmpty() ) {
|
||||
this.emit( 'allRead' );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue