Fix search for elements on current route path
This commit is contained in:
parent
5f9789bd24
commit
de51323561
1 changed files with 9 additions and 1 deletions
|
@ -159,10 +159,18 @@ export default {
|
|||
const tab = Object.keys(this.tabs).find(tab => {
|
||||
return this.tabs[tab].settings.includes(selectedValue.group === ':pleroma' ? selectedValue.key : selectedValue.group)
|
||||
})
|
||||
if (tab) {
|
||||
if (this.$router.currentRoute.path === `/settings/${tab}`) {
|
||||
this.scrollTo(selectedValue.key)
|
||||
} else if (tab) {
|
||||
this.$router.push({ path: `/settings/${tab}` })
|
||||
}
|
||||
},
|
||||
scrollTo(searchQuery) {
|
||||
const selectedSetting = document.querySelector(`[data-search="${searchQuery}"]`)
|
||||
if (selectedSetting) {
|
||||
selectedSetting.scrollIntoView({ block: 'start', behavior: 'smooth' })
|
||||
}
|
||||
},
|
||||
querySearch(queryString, cb) {
|
||||
const results = this.searchData.filter(searchObj => searchObj.search.find(el => el.includes(queryString.toLowerCase())))
|
||||
.map(searchObj => {
|
||||
|
|
Loading…
Reference in a new issue