* Fix ineffective option, fixed #10

* Feat: dropdown list, #6

* Fix repo url

* Feat: sidebar with toggle

* Update doc
This commit is contained in:
cinwell.li 2016-11-29 21:42:48 +08:00 committed by GitHub
commit d07ddaa85d
12 changed files with 380 additions and 24 deletions

View file

@ -70,3 +70,14 @@ export function activeLink (dom, activeParent) {
}
})
}
/**
* sidebar toggle
*/
export function bindToggle (dom) {
dom = typeof dom === 'object' ? dom : document.querySelector(dom)
if (!dom) return
const main = document.querySelector('main')
dom.addEventListener('click', () => main.classList.toggle('close'))
}