implement sapper no scroll

This commit is contained in:
Daniil Khanin
2018-10-05 00:13:08 +03:00
parent 3026e7c36e
commit 05b702938f
2 changed files with 6 additions and 4 deletions

View File

@@ -102,8 +102,9 @@ function handle_click(event: MouseEvent) {
if (url.pathname === location.pathname && url.search === location.search) return;
const target = select_route(url);
const has_scroll = a.hasAttribute('sapper-noscroll')
if (target) {
navigate(target, null);
navigate(target, null, has_scroll);
event.preventDefault();
history.pushState({ id: cid }, '', url.href);
}