From 27092b7ae9a7cb1d800c871e0c4ab873b6df1b8d Mon Sep 17 00:00:00 2001 From: Moriel Schottlender Date: Mon, 18 Jan 2016 15:04:54 -0800 Subject: [PATCH] Hide 'mark as read' for foreign NotificationGroupItem bundles As a product decision it was decided that foreign notifications cannot be 'mark all read' for their internal items. Bug: T121930 Change-Id: I79292401b69adc4fad601192009296e02e8410b5 --- .../mw.echo.ui.NotificationGroupItemWidget.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/ooui/mw.echo.ui.NotificationGroupItemWidget.js b/modules/ooui/mw.echo.ui.NotificationGroupItemWidget.js index 2c0d03182..9735fc44d 100644 --- a/modules/ooui/mw.echo.ui.NotificationGroupItemWidget.js +++ b/modules/ooui/mw.echo.ui.NotificationGroupItemWidget.js @@ -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. */