refactor(plugins): update search plugin
This commit is contained in:
parent
86594a3118
commit
079bd00395
22 changed files with 348 additions and 393 deletions
|
|
@ -45,8 +45,8 @@ export function scrollActiveSidebar () {
|
|||
const li = nav[last.getAttribute('data-id')]
|
||||
|
||||
if (!li || li === active) return
|
||||
if (active) active.classList.remove('active')
|
||||
|
||||
active && active.classList.remove('active')
|
||||
li.classList.add('active')
|
||||
active = li
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ export function scrollActiveSidebar () {
|
|||
|
||||
export function scrollIntoView (id) {
|
||||
const section = dom.find('#' + id)
|
||||
section && setTimeout(() => section.scrollIntoView(), 0)
|
||||
section && section.scrollIntoView()
|
||||
}
|
||||
|
||||
const scrollEl = dom.$.scrollingElement || dom.$.documentElement
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue