added default base page
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -140,8 +140,11 @@ import 'theme/assets/styles/main.scss'
|
||||
if (to.path == '/') {
|
||||
classes.push('path-home')
|
||||
} else {
|
||||
const path_parts = to.path.replace(/^\//, '').split('/')
|
||||
// TODO: remove language relative prefix from path classes (fr, en, etc)
|
||||
const path_parts = to.path
|
||||
.replace(/^\//, '')
|
||||
// remove language relative prefix from path classes (fr, en, etc)
|
||||
.replace(/^\D{2,3}\//, '')
|
||||
.split('/')
|
||||
for (var i = 0; i < path_parts.length; i++) {
|
||||
if (i == 0) {
|
||||
var c = 'path-' + path_parts[i]
|
||||
|
@@ -70,6 +70,12 @@ export default {
|
||||
this.$store.commit('Search/setTerm', params.get('term'))
|
||||
this.pagetitle = params.get('keys')
|
||||
this.newSearch()
|
||||
}else{
|
||||
// load default base page
|
||||
this.$store.commit('Search/setKeys', '')
|
||||
this.$store.commit('Search/setTerm', '')
|
||||
this.pagetitle = 'Base'
|
||||
this.newSearch()
|
||||
}
|
||||
},
|
||||
beforeRouteUpdate (to, from, next) {
|
||||
|
@@ -86,7 +86,11 @@ export default {
|
||||
commit('resetCount')
|
||||
commit('resetNoresults')
|
||||
commit('resetOffset')
|
||||
this.commit('Common/setPagetitle', state.keys)
|
||||
if(state.keys || state.term){
|
||||
this.commit('Common/setPagetitle', state.keys)
|
||||
}else{
|
||||
this.commit('Common/setPagetitle', 'Base')
|
||||
}
|
||||
dispatch('getResults')
|
||||
},
|
||||
nextPage ({ dispatch, commit, state }, $infiniteLoadingstate) {
|
||||
|
Reference in New Issue
Block a user