Display hompage on empty search
This commit is contained in:
parent
fbdd1eadef
commit
d7e332bab0
|
@ -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)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue