mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-12 09:18:59 +00:00
Merge "Don't render popup on "javascript:..." links."
This commit is contained in:
commit
4cba605476
|
@ -124,7 +124,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the hover event on links
|
* Register a hover event that may render a popup on an appropriate link.
|
||||||
*
|
*
|
||||||
* @method setupTriggers
|
* @method setupTriggers
|
||||||
*/
|
*/
|
||||||
|
@ -134,11 +134,14 @@
|
||||||
$this = $( this ),
|
$this = $( this ),
|
||||||
href = $this.attr( 'href' );
|
href = $this.attr( 'href' );
|
||||||
|
|
||||||
|
// No popup if scrolling or on certain kinds of links.
|
||||||
if (
|
if (
|
||||||
mw.popups.scrolled || // Prevents hovering on popups while scrolling
|
mw.popups.scrolled || // Prevents hovering on popups while scrolling
|
||||||
href.indexOf( '?' ) !== -1 ||
|
href.indexOf( '?' ) !== -1 ||
|
||||||
|
href.indexOf( 'javascript:' ) === 0 || // jshint ignore:line
|
||||||
href.indexOf( location.origin + location.pathname + '#' ) === 0
|
href.indexOf( location.origin + location.pathname + '#' ) === 0
|
||||||
) {
|
) {
|
||||||
|
// TODO No popup for this, but removeTooltips() has already blanked the title.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue