diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-02 22:10:44 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-02 22:10:44 +0800 |
commit | a2b262c9df127102a4508273d2a3564c5c004788 (patch) | |
tree | 51d0ce62664b27d2a618ef19325debd80d69b5f9 /packages/website/ts/pages/shared/markdown_link_block.tsx | |
parent | 5906f4c9953b65421a16b947a5e03898281483bc (diff) | |
download | dexon-sol-tools-a2b262c9df127102a4508273d2a3564c5c004788.tar dexon-sol-tools-a2b262c9df127102a4508273d2a3564c5c004788.tar.gz dexon-sol-tools-a2b262c9df127102a4508273d2a3564c5c004788.tar.bz2 dexon-sol-tools-a2b262c9df127102a4508273d2a3564c5c004788.tar.lz dexon-sol-tools-a2b262c9df127102a4508273d2a3564c5c004788.tar.xz dexon-sol-tools-a2b262c9df127102a4508273d2a3564c5c004788.tar.zst dexon-sol-tools-a2b262c9df127102a4508273d2a3564c5c004788.zip |
Add hash to URL onClick
Diffstat (limited to 'packages/website/ts/pages/shared/markdown_link_block.tsx')
-rw-r--r-- | packages/website/ts/pages/shared/markdown_link_block.tsx | 4 |
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); } } |