feat: custom sidebar, #4 (#5)

* feat: custom sidebar, #4

* fix dev html

* fix doc

* fix doc
This commit is contained in:
cinwell.li 2016-11-27 18:53:31 +08:00 committed by GitHub
commit 37e7984e7e
6 changed files with 71 additions and 15 deletions

View file

@ -1,5 +1,5 @@
function scrollActiveSidebar () {
if (/mobile/i.test(navigator.userAgent)) return
function scrollActiveSidebar (isCustom) {
if (/mobile/i.test(navigator.userAgent) || isCustom) return
const anchors = document.querySelectorAll('.anchor')
const nav = {}
@ -48,6 +48,6 @@ function scrollActiveSidebar () {
scrollIntoView()
}
export default function () {
scrollActiveSidebar()
export default function (isCustom) {
scrollActiveSidebar(isCustom)
}