mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-18 05:25:08 +00:00
overhaul tests
This commit is contained in:
@@ -4,7 +4,11 @@ import { Target } from '../types';
|
||||
export default function prefetch(href: string) {
|
||||
const target: Target = select_route(new URL(href, document.baseURI));
|
||||
|
||||
if (target && (!prefetching || href !== prefetching.href)) {
|
||||
set_prefetching(href, prepare_page(target));
|
||||
if (target) {
|
||||
if (!prefetching || href !== prefetching.href) {
|
||||
set_prefetching(href, prepare_page(target));
|
||||
}
|
||||
|
||||
return prefetching.promise;
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ function handle_click(event: MouseEvent) {
|
||||
|
||||
const target = select_route(url);
|
||||
if (target) {
|
||||
const noscroll = a.hasAttribute('sapper-noscroll')
|
||||
const noscroll = a.hasAttribute('sapper-noscroll');
|
||||
navigate(target, null, noscroll);
|
||||
event.preventDefault();
|
||||
history.pushState({ id: cid }, '', url.href);
|
||||
|
||||
Reference in New Issue
Block a user