mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 17:50:39 +00:00
623d07011c
The flyout loads no more than 25 notifications from a given source. Using those in-memory notification objects to count how many are currently unread (and update the badge) produces a result of at most 25. This patch extracts the responsibility or counting the unread from the Model/Item/Groupitem structure into a new UnreadNotificationCounter class. It receives estimated updates from other components and synchronizes with the server after markRead/markUnread operations have completed. Bug: T129726 Change-Id: I9af4defc00dd491ed2b355eb4e85073476e08ce7
28 lines
596 B
JavaScript
28 lines
596 B
JavaScript
( function ( mw ) {
|
|
/**
|
|
* Notification list
|
|
*
|
|
* @class
|
|
* @mixins OO.EventEmitter
|
|
* @mixins mw.echo.dm.List
|
|
*
|
|
* @constructor
|
|
* @param {Object} [config] Configuration object
|
|
*/
|
|
mw.echo.dm.NotificationList = function MwEchoDmNotificationList() {
|
|
|
|
// Mixin constructor
|
|
OO.EventEmitter.call( this );
|
|
|
|
// Mixin constructor
|
|
mw.echo.dm.List.call( this );
|
|
};
|
|
|
|
/* Initialization */
|
|
|
|
OO.initClass( mw.echo.dm.NotificationList );
|
|
OO.mixinClass( mw.echo.dm.NotificationList, OO.EventEmitter );
|
|
OO.mixinClass( mw.echo.dm.NotificationList, mw.echo.dm.List );
|
|
|
|
} )( mediaWiki );
|