jenkins-bot has submitted this change and it was merged.
Change subject: If there is a primary link, make the entire notification
clickable
......................................................................
If there is a primary link, make the entire notification clickable
Per Vibha
Change-Id: I987bb8d466ee5ce78cf4a3225fec4ea143cb1f79
---
M javascripts/modules/notifications.js
M less/modules/notifications.less
M stylesheets/modules/notifications.css
3 files changed, 19 insertions(+), 0 deletions(-)
Approvals:
JGonera: Looks good to me, approved
jenkins-bot: Verified
diff --git a/javascripts/modules/notifications.js
b/javascripts/modules/notifications.js
index 48e56f7..7f35fa9 100644
--- a/javascripts/modules/notifications.js
+++ b/javascripts/modules/notifications.js
@@ -55,6 +55,19 @@
options.errorMessage =
mw.msg( 'echo-none' );
}
self.render( options );
+
+ // If there is a primary link,
make the entire notification clickable.
+ $( '.mw-echo-notification'
).each( function() {
+ var $notification = $(
this ),
+ $primaryLink =
$notification.find( '.mw-echo-notification-primary-link' );
+ if (
$primaryLink.length ) {
+
$notification.css( 'cursor', 'pointer' );
+
$notification.click( function() {
+
window.location.href = $primaryLink.attr( 'href' );
+ } );
+ }
+ } );
+
self.markAllAsRead();
} ).fail( function () {
self._error();
diff --git a/less/modules/notifications.less b/less/modules/notifications.less
index be23f0a..c9b559f 100644
--- a/less/modules/notifications.less
+++ b/less/modules/notifications.less
@@ -17,4 +17,7 @@
.mw-echo-notification-primary-link {
display: none;
}
+ .mw-echo-notification:hover {
+ background-color: #F9F9F9;
+ }
}
diff --git a/stylesheets/modules/notifications.css
b/stylesheets/modules/notifications.css
index a2e425f..872cd10 100644
--- a/stylesheets/modules/notifications.css
+++ b/stylesheets/modules/notifications.css
@@ -20,3 +20,6 @@
.mw-mf-overlay .mw-echo-notification-primary-link {
display: none;
}
+.mw-mf-overlay .mw-echo-notification:hover {
+ background-color: #F9F9F9;
+}
--
To view, visit https://gerrit.wikimedia.org/r/81895
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I987bb8d466ee5ce78cf4a3225fec4ea143cb1f79
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits