mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 09:40:41 +00:00
Don't show the overlay if the badge is not near the top of the window
Bug: 58728 Change-Id: Ia714425078c277d65af99389c95014d87e138e8c
This commit is contained in:
parent
3932d39a10
commit
3dc2b10b78
|
@ -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 *' ) ) {
|
||||
|
|
Loading…
Reference in a new issue