Merge "Hide 'mark as read' for foreign NotificationGroupItem bundles"

This commit is contained in:
jenkins-bot 2016-01-18 23:23:19 +00:00 committed by Gerrit Code Review
commit c826294f30

View file

@ -22,6 +22,11 @@
OO.ui.mixin.GroupWidget.call( this, config );
OO.ui.mixin.PendingElement.call( this, config );
// Hide the [x] mark as read button for foreign notifications
if ( this.getModel().isForeign() ) {
this.markAsReadButton.toggle( false );
}
this.setPendingElement( this.$group );
this.$group
.addClass( 'mw-echo-ui-notificationGroupItemWidget-group' )
@ -229,6 +234,19 @@
}
};
/**
* @inheritdoc
*/
mw.echo.ui.NotificationGroupItemWidget.prototype.toggleRead = function ( read ) {
// Parent method
mw.echo.ui.NotificationGroupItemWidget.parent.toggleRead.call( this, read );
if ( this.getModel().isForeign() ) {
// Never show the [x] mark-all-unread button for foreign bundles
this.markAsReadButton.toggle( false );
}
};
/**
* Check whether the titles should be shown and toggle them in the items.
*/