Display hompage on empty search

This commit is contained in:
Chocobozzz 2020-09-21 11:29:47 +02:00
parent fbdd1eadef
commit d7e332bab0
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 10 additions and 0 deletions

View File

@ -502,6 +502,12 @@
const scrollToResults = urlPage && parseInt(urlPage) !== this.currentPage
this.loadUrl()
if (!this.formSearch) {
this.simpleFormReset(false)
this.scrollToTop()
return
}
this.doSearch()
if (scrollToResults) this.scrollToResults()
},
@ -902,6 +908,10 @@
scrollToResults () {
const anchor = document.getElementById('results-anchor')
if (anchor) anchor.scrollIntoView()
},
scrollToTop () {
window.scrollTo(0, 0)
}
}
})