#1906, click on header menu base reset search
This commit is contained in:
@@ -72,7 +72,7 @@ export default {
|
||||
this.$store.commit('Search/setKeys', keys)
|
||||
this.pagetitle = keys.join(', ') //params.get('keys')
|
||||
} else {
|
||||
this.$store.commit('Search/setKeys', '')
|
||||
this.$store.commit('Search/reSetKeys')
|
||||
this.pagetitle = 'Base'
|
||||
}
|
||||
|
||||
@@ -81,13 +81,13 @@ export default {
|
||||
// this.$store.commit('Search/setTerms', params.get('terms').split(','))
|
||||
this.$store.commit('Search/setTerms', JSON.parse(params.get('terms')))
|
||||
} else {
|
||||
this.$store.commit('Search/setTerms', [])
|
||||
this.$store.commit('Search/reSetTerms')
|
||||
}
|
||||
|
||||
if (params.has('filters')) {
|
||||
this.$store.commit('Search/setFilters', params.get('filters').split(','))
|
||||
} else {
|
||||
this.$store.commit('Search/setFilters', [])
|
||||
this.$store.commit('Search/reSetFilters')
|
||||
}
|
||||
|
||||
this.newSearch()
|
||||
@@ -95,16 +95,27 @@ export default {
|
||||
beforeRouteUpdate (to, from, next) {
|
||||
// when query change launch a new search
|
||||
console.log('Base beforeRouteUpdate', to, from, next)
|
||||
|
||||
// todo text field of search form is not emptying on clicking on base after a search
|
||||
// this.$store.commit('Search/setKeys', to.query.keys)
|
||||
const r = /,\s?$/
|
||||
let keys = to.query.keys.replace(r,'').split(', ')
|
||||
console.log('Base created, keys', keys)
|
||||
this.$store.commit('Search/setKeys', keys)
|
||||
|
||||
this.$store.commit('Search/setTerms', to.query.terms)
|
||||
this.$store.commit('Search/setFilters', to.query.filters)
|
||||
this.pagetitle = to.query.keys
|
||||
if (to.query.hasOwnProperty('terms')) {
|
||||
this.$store.commit('Search/setTerms', to.query.terms)
|
||||
}else{
|
||||
this.$store.commit('Search/reSetTerms')
|
||||
}
|
||||
if (to.query.hasOwnProperty('filters')) {
|
||||
this.$store.commit('Search/setFilters', to.query.filters)
|
||||
}else{
|
||||
this.$store.commit('Search/reSetFilters')
|
||||
}
|
||||
if (to.query.hasOwnProperty('keys')) {
|
||||
const r = /,\s?$/
|
||||
let keys = to.query.keys.replace(r,'').split(', ')
|
||||
console.log('Base created, keys', keys)
|
||||
this.$store.commit('Search/setKeys', keys)
|
||||
this.pagetitle = to.query.keys
|
||||
}else{
|
||||
this.$store.commit('Search/reSetKeys')
|
||||
}
|
||||
this.newSearch()
|
||||
next()
|
||||
},
|
||||
|
Reference in New Issue
Block a user