Fix TypeError on <a> with no href

HTML5 allows <a> elements with no href="..." attribute. We do this in
Wikibase/Wikidata in a few places. Hovering these <a> elements causes
TypeErrors.

This is a hotfix. Please see Ie340648 for a much more advanced fix.

Change-Id: Ib20ef8348c964a6ba736d0fc76909fd4d496c11e
This commit is contained in:
Thiemo Mättig 2015-02-12 15:37:37 +01:00
parent d229877afb
commit bf4016ecf1

View file

@ -144,6 +144,7 @@
// No popup if scrolling or on certain kinds of links.
if (
mw.popups.scrolled || // Prevents hovering on popups while scrolling
!href ||
href.indexOf( '?' ) !== -1 ||
href.indexOf( 'javascript:' ) === 0 || // jshint ignore:line
href.indexOf( location.origin + location.pathname + '#' ) === 0