This commit is contained in:
Rich Harris
2018-10-15 21:36:40 -04:00
parent a68c62ce91
commit 2e3aef8b21

View File

@@ -83,12 +83,8 @@ function handle_click(event: MouseEvent) {
const svg = typeof a.href === 'object' && a.href.constructor.name === 'SVGAnimatedString';
const href = String(svg ? (<SVGAElement>a).href.baseVal : a.href);
if (location.hash && href === location.href) {
return;
}
if (href === location.href) {
event.preventDefault();
if (!location.hash) event.preventDefault();
return;
}