Skip to content
Snippets Groups Projects
Commit 163d8920 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

radioknapp for "begge" ny default, ser etter "lang" i query

parent e61617fc
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
</Preview> </Preview>
</template> </template>
</autocomplete> </autocomplete>
<input type="radio" id="radio_both" value="nob,nno" v-model="lang">
<label for="radio_both">Begge</label>
<input type="radio" id="radio_nob" value="nob" v-model="lang"> <input type="radio" id="radio_nob" value="nob" v-model="lang">
<label for="radio_nob">Bokmål</label> <label for="radio_nob">Bokmål</label>
<input type="radio" id="radio_nno" value="nno" v-model="lang"> <input type="radio" id="radio_nno" value="nno" v-model="lang">
...@@ -123,7 +125,7 @@ export default { ...@@ -123,7 +125,7 @@ export default {
} }
}, },
mounted: function(){ mounted: function(){
this.lang = this.$route.params.lang || 'nob' this.lang = this.$route.params.lang || this.$route.query.lang || 'nob,nno'
var self = this; var self = this;
if(this.$route.query.q) { if(this.$route.query.q) {
axios.get(api_endpoint + '/' + self.lang + '/_search?q=' + self.$route.query.q + ' ' + self.$route.query.q + '*&sort=_score') axios.get(api_endpoint + '/' + self.lang + '/_search?q=' + self.$route.query.q + ' ' + self.$route.query.q + '*&sort=_score')
...@@ -147,7 +149,7 @@ export default { ...@@ -147,7 +149,7 @@ export default {
}, },
watch: { watch: {
$route(to, from) { $route(to, from) {
this.lang = this.$route.params.lang || 'nob' this.lang = this.$route.params.lang || this.$route.query.lang || 'nob,nno'
} }
} }
} }
......
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