mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-13 17:57:21 +00:00
Allow marking all as read from popout window
Clicking 'mark all as read' would only mark the notifications you are viewing as read instead of all of them - now it will mark all of them as read. Bug: T156425 Change-Id: If46a85f91dfddd4ac158e5c3a4f942c9c3d9aac1
This commit is contained in:
parent
0704644ee0
commit
aeafb09d80
|
@ -499,13 +499,11 @@
|
||||||
*/
|
*/
|
||||||
mw.echo.Controller.prototype.markLocalNotificationsRead = function () {
|
mw.echo.Controller.prototype.markLocalNotificationsRead = function () {
|
||||||
var modelName, model,
|
var modelName, model,
|
||||||
itemIds = [],
|
|
||||||
readState = this.manager.getFiltersModel().getReadState(),
|
readState = this.manager.getFiltersModel().getReadState(),
|
||||||
modelItems = {};
|
modelItems = {};
|
||||||
|
|
||||||
this.manager.getLocalNotifications().forEach( function ( notification ) {
|
this.manager.getLocalNotifications().forEach( function ( notification ) {
|
||||||
if ( !notification.isRead() ) {
|
if ( !notification.isRead() ) {
|
||||||
itemIds = itemIds.concat( notification.getAllIds() );
|
|
||||||
notification.toggleRead( true );
|
notification.toggleRead( true );
|
||||||
|
|
||||||
modelName = notification.getModelName();
|
modelName = notification.getModelName();
|
||||||
|
@ -525,9 +523,8 @@
|
||||||
// Update pagination count
|
// Update pagination count
|
||||||
this.manager.updateCurrentPageItemCount();
|
this.manager.updateCurrentPageItemCount();
|
||||||
|
|
||||||
this.manager.getUnreadCounter().estimateChange( -itemIds.length );
|
this.manager.getLocalCounter().setCount( 0, false );
|
||||||
this.manager.getLocalCounter().estimateChange( -itemIds.length );
|
return this.api.markAllRead( 'local', this.getTypeString() ).then( this.refreshUnreadCount.bind( this ) );
|
||||||
return this.api.markItemsRead( itemIds, 'local', true ).then( this.refreshUnreadCount.bind( this ) );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue