diff --git a/modules/model/mw.echo.dm.BundleNotificationItem.js b/modules/model/mw.echo.dm.BundleNotificationItem.js index 923dcced7..62f736324 100644 --- a/modules/model/mw.echo.dm.BundleNotificationItem.js +++ b/modules/model/mw.echo.dm.BundleNotificationItem.js @@ -36,7 +36,6 @@ this.list = new mw.echo.dm.NotificationsList(); this.list.setItems( bundledNotificationModels ); - this.list.aggregate( { update: 'itemUpdate' } ); this.list.connect( this, { itemUpdate: 'onItemUpdate' } ); // For bundles, 'read' is a computed state based on diff --git a/modules/model/mw.echo.dm.ModelManager.js b/modules/model/mw.echo.dm.ModelManager.js index 976a629b1..0aa0668f6 100644 --- a/modules/model/mw.echo.dm.ModelManager.js +++ b/modules/model/mw.echo.dm.ModelManager.js @@ -112,7 +112,6 @@ localModel = this.getNotificationModel( 'local' ); if ( localModel ) { - localModel.aggregate( { update: 'itemUpdate' } ); localModel.connect( this, { itemUpdate: 'checkLocalUnreadTalk' } ); } diff --git a/modules/model/mw.echo.dm.NotificationsList.js b/modules/model/mw.echo.dm.NotificationsList.js index f034651dc..30341491d 100644 --- a/modules/model/mw.echo.dm.NotificationsList.js +++ b/modules/model/mw.echo.dm.NotificationsList.js @@ -55,6 +55,9 @@ // Fallback on IDs return b.getId() - a.getId(); } ); + + // Events + this.aggregate( { update: 'itemUpdate' } ); }; /* Initialization */ @@ -69,6 +72,13 @@ * The list has been updated */ + /** + * @event itemUpdate + * @param {mw.echo.dm.NotificationItem} item Item that has changed + * + * An item in the list has been updated + */ + /* Methods */ /** diff --git a/modules/ui/mw.echo.ui.SubGroupListWidget.js b/modules/ui/mw.echo.ui.SubGroupListWidget.js index a9ab55eac..f4938cfaf 100644 --- a/modules/ui/mw.echo.ui.SubGroupListWidget.js +++ b/modules/ui/mw.echo.ui.SubGroupListWidget.js @@ -85,9 +85,6 @@ // Update all items update: 'resetItemsFromModel' } ); - // We must aggregate on item update, so we know when and if all - // items are read and can hide/show the 'mark all read' button - this.model.aggregate( { update: 'itemUpdate' } ); this.model.connect( this, { itemUpdate: 'toggleMarkAllReadButton' } ); this.markAllReadButton.connect( this, { click: 'onMarkAllReadButtonClick' } );