Skip to content
Snippets Groups Projects
Commit 724295dd authored by Henrik Askjer's avatar Henrik Askjer
Browse files

omit pos parameter when default

parent e98ae35c
No related branches found
No related tags found
No related merge requests found
......@@ -267,7 +267,11 @@ export default {
select_result: function (event) {
this.event = event
let path = `/${this.lang}/search`
let query = {q: event.match || event.q, pos: this.pos_param(), scope: this.scope}
let pos = this.pos_param()
let query = {q: event.match || event.q}
console.log(pos)
if (pos != "all") query["pos"] = pos
if (this.scope) query["scope"] = this.scope
this.$router.push({path, query})
navigate_to_query(this)
......@@ -288,7 +292,10 @@ export default {
let q = (this.$route.query || this.$route.params).q
if (q) {
let path = `/${this.lang}/search`
let query = {q: q, pos: this.pos_param(), scope: this.scope}
let pos = this.pos_param()
let query = {q: q}
if (pos != 'all') query.pos = pos
if (this.scope) query.scope = this.scope
this.$router.push({path, query})
navigate_to_query(this, q)
}
......
......@@ -95,7 +95,7 @@ const router = new VueRouter({
{
path: 'search',
name: 'query',
params: {q: '', pos: 'all', scope: 'w'}
params: {q: '', scope: 'w'}
},
{
name: 'word',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment