Skip to content

Commit

Permalink
fix(docs): scroll to active element
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Mucsicska committed Oct 15, 2017
1 parent 76ffa20 commit 901e93e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions site/template/res/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
activationStartTime = new Date().getTime()
nextActiveElement.classList.add('active')
activeElement = nextActiveElement
var toc = document.querySelector('.table-of-contents ul')
toc.scrollTop = activeElement.offsetTop - (toc.clientHeight - activeElement.offsetHeight) / 2
}
}

Expand Down

0 comments on commit 901e93e

Please sign in to comment.