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

null as default pos

parent 911fae56
No related branches found
No related tags found
No related merge requests found
......@@ -317,6 +317,7 @@ export default {
}
},
select_suggestion: function (word) {
this.pos_selected = null
this.event = null
this.inflection_suggestions = null
navigate_to_query(this, word)
......@@ -327,7 +328,7 @@ export default {
let path = `/${this.lang}/search`
let pos = this.pos_param()
let query = {q: event.match || event.q}
if (pos != "all") query["pos"] = pos
if (pos) query["pos"] = pos
if (this.scope) query["scope"] = this.scope
this.$router.push({path, query})
navigate_to_query(this)
......@@ -384,9 +385,7 @@ export default {
generate_path: function(q) {
if (q) {
let path = `/${this.lang}/search?q=${q}`
let pos = this.pos_param()
if (pos != 'all') path += "&pos=" + pos
let path = `/${this.lang}/search?q=${q}&scope=${this.scope}`
if (this.scope) path += "&scope=" + this.scope
return path
}
......@@ -398,7 +397,7 @@ export default {
let path = `/${this.lang}/search`
let pos = this.pos_param()
let query = {q: q}
if (pos != 'all') query.pos = pos
if (pos) query.pos = pos
if (this.scope) query.scope = this.scope
this.$router.push({path, query})
navigate_to_query(this, q)
......@@ -465,7 +464,8 @@ export default {
self.lang = self.$route.params.lang || this.$store.state.defaultDict
if (self.$route.query.pos) {
self.pos_selected = self.$route.query.pos.toUpperCase()
}
} else self.pos_selected = null
if (self.$route.query.scope) {
self.scope = self.$route.query.scope
}
......
......@@ -4,8 +4,8 @@
<v-row >
<v-col :cols="$vuetify.breakpoint.smAndDown ? 12 : 3">
<v-autocomplete
auto-select-first
clearable
v-model="$parent.pos_selected"
hide-details
......@@ -99,7 +99,7 @@ export default {
this.$emit('updateScope', "wb")
},
updatePos (pos) {
this.$emit('updatePos', pos || 'ALL')
this.$emit('updatePos', pos)
}
}
}
......
......@@ -42,7 +42,6 @@
"back": "Tilbake",
"back_to_results": "Tilbake til søkjeresultat",
"pos": {
"ALL": "alle ordklasser",
"NOUN": "substantiv",
"PRON": "pronomen",
"DET": "determinativ",
......
......@@ -42,7 +42,6 @@
"back": "Tilbake",
"back_to_results": "Tilbake til søkeresultater",
"pos": {
"ALL": "alle ordklasser",
"NOUN": "substantiv",
"PRON": "pronomen",
"DET": "determinativ",
......
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