mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
update urls on TOC click
This commit is contained in:
parent
956fe45529
commit
7f555bbe11
@ -41,6 +41,11 @@ export default class TocScroll extends React.Component {
|
||||
scroll
|
||||
? this.scrollTo(elem, offset, timeout)
|
||||
: console.log(`Element not found: ${element}`) // eslint-disable-line
|
||||
|
||||
// update browser url
|
||||
if (typeof window !== 'undefined') {
|
||||
window.history.pushState({}, null, `#${element}`)
|
||||
}
|
||||
}
|
||||
|
||||
scrollTo(element, offSet = 0, timeout = null) {
|
||||
|
Loading…
Reference in New Issue
Block a user