Merge "Don't render popup on "javascript:..." links."

This commit is contained in:
Prtksxna 2014-08-13 11:08:46 +00:00 committed by Gerrit Code Review
commit 4cba605476

View file

@ -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;
} }