0.6.0 (#12)
* Fix ineffective option, fixed #10 * Feat: dropdown list, #6 * Fix repo url * Feat: sidebar with toggle * Update doc
This commit is contained in:
parent
dd361b34b9
commit
d07ddaa85d
12 changed files with 380 additions and 24 deletions
11
src/event.js
11
src/event.js
|
|
@ -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'))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue