feat: 进入插件自动切换到第一个Nav

This commit is contained in:
ZiuChen 2022-08-16 12:33:08 +08:00
parent 35d0723436
commit 88acf6428d

View File

@ -180,6 +180,8 @@ const focus = () => document.querySelector('.clip-search input')?.focus()
const toTop = () => (document.scrollingElement.scrollTop = 0) const toTop = () => (document.scrollingElement.scrollTop = 0)
const resetNav = () => document.querySelectorAll('.clip-switch-item')[0]?.click()
const db = new DB(DBPath) const db = new DB(DBPath)
db.init() db.init()
@ -199,6 +201,7 @@ watchClipboard(db, (item) => {
utools.onPluginEnter(() => { utools.onPluginEnter(() => {
focus() focus()
toTop() toTop()
resetNav()
}) })
window.db = db window.db = db