mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 17:00:37 +00:00
Clicking a Hovercards legible link should close popup
A click event is used to capture links that may be clicked via the keyboard. Bug: T143051 Change-Id: Ifd6f75c2a53d8d7b5ef9fd3f232f85b55eea24c8
This commit is contained in:
parent
9f92324b4d
commit
f974a024f4
|
@ -258,6 +258,9 @@
|
||||||
if ( action === 'opened in same tab' ) {
|
if ( action === 'opened in same tab' ) {
|
||||||
window.location.href = $activeLink.attr( 'href' );
|
window.location.href = $activeLink.attr( 'href' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// close the popup
|
||||||
|
mw.popups.render.closePopup();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -138,6 +138,11 @@
|
||||||
mw.popups.$content = $content;
|
mw.popups.$content = $content;
|
||||||
$elements = mw.popups.selectPopupElements();
|
$elements = mw.popups.selectPopupElements();
|
||||||
|
|
||||||
|
// On clicking a link the open popup (if any) should be hidden. (T143051)
|
||||||
|
$elements.on( 'click', function () {
|
||||||
|
mw.popups.render.closePopup();
|
||||||
|
} );
|
||||||
|
|
||||||
$elements.on( 'mouseenter focus', function ( event ) {
|
$elements.on( 'mouseenter focus', function ( event ) {
|
||||||
var $link = $( this );
|
var $link = $( this );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue