mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-19 22:05:20 +00:00
simplify
This commit is contained in:
@@ -83,12 +83,8 @@ function handle_click(event: MouseEvent) {
|
|||||||
const svg = typeof a.href === 'object' && a.href.constructor.name === 'SVGAnimatedString';
|
const svg = typeof a.href === 'object' && a.href.constructor.name === 'SVGAnimatedString';
|
||||||
const href = String(svg ? (<SVGAElement>a).href.baseVal : a.href);
|
const href = String(svg ? (<SVGAElement>a).href.baseVal : a.href);
|
||||||
|
|
||||||
if (location.hash && href === location.href) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (href === location.href) {
|
if (href === location.href) {
|
||||||
event.preventDefault();
|
if (!location.hash) event.preventDefault();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user