diff --git a/modules/ooui/mw.echo.ui.NotificationOptionWidget.js b/modules/ooui/mw.echo.ui.NotificationOptionWidget.js index 040339a6a..6fa26ef9e 100644 --- a/modules/ooui/mw.echo.ui.NotificationOptionWidget.js +++ b/modules/ooui/mw.echo.ui.NotificationOptionWidget.js @@ -40,8 +40,18 @@ this.$element .addClass( 'mw-echo-ui-notificationOptionWidget' ) .append( - this.markAsReadButton.$element, - this.$label + // HACK: Wrap the entire option with a link that takes + // the user to the primary url. This is not perfect, + // but it makes the behavior native to the browser rather + // than us listening to click events and opening new + // windows. + $( '' ) + .addClass( 'mw-echo-ui-notificationOptionWidget-linkWrapper' ) + .attr( 'href', this.model.getPrimaryUrl() ) + .append( + this.markAsReadButton.$element, + this.$label + ) ); this.$element.toggleClass( 'mw-echo-ui-notificationOptionWidget-initiallyUnseen', !this.model.isSeen() ); diff --git a/modules/ooui/mw.echo.ui.NotificationsWidget.js b/modules/ooui/mw.echo.ui.NotificationsWidget.js index ca00b5f84..7812b8e1d 100644 --- a/modules/ooui/mw.echo.ui.NotificationsWidget.js +++ b/modules/ooui/mw.echo.ui.NotificationsWidget.js @@ -34,9 +34,6 @@ remove: 'onModelNotificationRemove', clear: 'onModelNotificationClear' } ); - this.connect( this, { - choose: 'onNotificationChoose' - } ); this.$element .addClass( 'mw-echo-ui-notificationsWidget' ); @@ -128,26 +125,4 @@ this.addItems( [ this.loadingOptionWidget ] ); } }; - - /** - * Respond to choosing a notification option - * - * @param {mw.echo.ui.NotificationOptionWidget} item Notification option - */ - mw.echo.ui.NotificationsWidget.prototype.onNotificationChoose = function ( item ) { - var link; - - if ( !item ) { - return; - } - - link = item.getPrimaryUrl(); - if ( link ) { - // Log the clickthrough - mw.echo.logger.logInteraction( 'notification-link-click', item.getData(), this.type ); - - // Follow the link - window.location.href = link; - } - }; } )( mediaWiki, jQuery ); diff --git a/modules/ooui/styles/mw.echo.ui.NotificationOptionWidget.less b/modules/ooui/styles/mw.echo.ui.NotificationOptionWidget.less index ba6f8418e..05c22278e 100644 --- a/modules/ooui/styles/mw.echo.ui.NotificationOptionWidget.less +++ b/modules/ooui/styles/mw.echo.ui.NotificationOptionWidget.less @@ -8,6 +8,15 @@ font-size: 13px; line-height: 16px; + &:hover > a { + text-decoration: none; + } + + &:not(:hover) a, + #p-personal &:not(:hover) a.new { + color: #666666; + } + &:last-child { border-bottom: none; } @@ -29,12 +38,6 @@ } } - &:not(:hover) a, - #p-personal &:not(:hover) a.new { - color: #666666; - text-decoration: none; - } - &-initiallyUnseen { -webkit-animation-name: unseen-fadeout; animation-name: unseen-fadeout;