Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/103100
Change subject: Don't show the overlay if the badge is not near the top of the
window
......................................................................
Don't show the overlay if the badge is not near the top of the window
Bug: 58728
Change-Id: Ia714425078c277d65af99389c95014d87e138e8c
---
M modules/overlay/ext.echo.overlay.js
1 file changed, 8 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/00/103100/1
diff --git a/modules/overlay/ext.echo.overlay.js
b/modules/overlay/ext.echo.overlay.js
index 0f24c0c..73e211f 100644
--- a/modules/overlay/ext.echo.overlay.js
+++ b/modules/overlay/ext.echo.overlay.js
@@ -272,11 +272,17 @@
$link.click( function ( e ) {
var $target;
- e.preventDefault();
-
// log the badge click
mw.echo.logInteraction( 'ui-badge-link-click' );
+ // If the link is not near the top of the window,
showing the overlay below it
+ // will likely look very silly, so let's not do this
and just go the special page
+ if ( $link.offset().top > 0.2 * $( window ).height() ) {
+ return;
+ }
+
+ e.preventDefault();
+
$target = $( e.target );
// If the user clicked on the overlay or any child,
ignore the click
if ( $target.hasClass( 'mw-echo-overlay' ) ||
$target.is( '.mw-echo-overlay *' ) ) {
--
To view, visit https://gerrit.wikimedia.org/r/103100
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia714425078c277d65af99389c95014d87e138e8c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits