aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-02 22:10:44 +0800
committerFabio Berger <me@fabioberger.com>2018-03-02 22:10:44 +0800
commita2b262c9df127102a4508273d2a3564c5c004788 (patch)
tree51d0ce62664b27d2a618ef19325debd80d69b5f9
parent5906f4c9953b65421a16b947a5e03898281483bc (diff)
downloaddexon-0x-contracts-a2b262c9df127102a4508273d2a3564c5c004788.tar
dexon-0x-contracts-a2b262c9df127102a4508273d2a3564c5c004788.tar.gz
dexon-0x-contracts-a2b262c9df127102a4508273d2a3564c5c004788.tar.bz2
dexon-0x-contracts-a2b262c9df127102a4508273d2a3564c5c004788.tar.lz
dexon-0x-contracts-a2b262c9df127102a4508273d2a3564c5c004788.tar.xz
dexon-0x-contracts-a2b262c9df127102a4508273d2a3564c5c004788.tar.zst
dexon-0x-contracts-a2b262c9df127102a4508273d2a3564c5c004788.zip
Add hash to URL onClick
-rw-r--r--packages/website/ts/pages/shared/markdown_link_block.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/website/ts/pages/shared/markdown_link_block.tsx b/packages/website/ts/pages/shared/markdown_link_block.tsx
index a8246f654..45bb41478 100644
--- a/packages/website/ts/pages/shared/markdown_link_block.tsx
+++ b/packages/website/ts/pages/shared/markdown_link_block.tsx
@@ -38,7 +38,9 @@ export class MarkdownLinkBlock extends React.Component<MarkdownLinkBlockProps, M
}
}
private _onHashUrlClick(href: string) {
- const hashWithPrefix = `#${href.split('#')[1]}`;
+ const hash = href.split('#')[1];
+ const hashWithPrefix = `#${hash}`;
utils.scrollToHash(hashWithPrefix, configs.SCROLL_CONTAINER_ID);
+ utils.setUrlHash(hash);
}
}