Skip to content
Snippets Groups Projects
Commit 40cf8105 authored by Petr.Kalashnikov's avatar Petr.Kalashnikov
Browse files

Merge branch 'reload_lang_change' into 'master'

Fix search-option in url

See merge request spraksamlingane/beta.ordbok.uib.no!12
parents 83842e8a 3ecda17a
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<main> <main>
<div class="search_container"> <div class="search_container">
<div class="lang_select_container"> <div class="lang_select_container">
<v-radio-group row v-model="lang" @change="force_rerender"> <v-radio-group row v-model="lang" @change="update_lang_form">
<template v-slot:label> <template v-slot:label>
<span>VIS</span> <span>VIS</span>
</template> </template>
...@@ -201,7 +201,6 @@ export default { ...@@ -201,7 +201,6 @@ export default {
if(event.articles){ if(event.articles){
let source = '/' + this.lang + '/w/' + event.word let source = '/' + this.lang + '/w/' + event.word
this.$router.push(source) this.$router.push(source)
console.log(this.$router)
this.search_results = event.articles.sort(compare_by_hgno(decodeURIComponent(event.word))).map(a => Object.assign(a, {source: source})) this.search_results = event.articles.sort(compare_by_hgno(decodeURIComponent(event.word))).map(a => Object.assign(a, {source: source}))
this.article = null this.article = null
this.error = null this.error = null
...@@ -215,13 +214,13 @@ export default { ...@@ -215,13 +214,13 @@ export default {
this.$plausible.trackEvent('dropdown selection', {props: {query: event.label, match: '<fritekstsøk>'}}) this.$plausible.trackEvent('dropdown selection', {props: {query: event.label, match: '<fritekstsøk>'}})
} }
}, },
force_rerender: function(event) { update_lang_form: function(event) {
if (this.event){ if (this.event){
this.event.articles = null this.event.articles = null
this.select_result(this.event) this.select_result(this.event)
} }
else{ else{
navigate_to_search(this, this.$router.history.current.params.word) navigate_to_search(this, this.$router.history.current.params.word || this.$router.history.current.params.query)
} }
}, },
article_link_click: function(item) { article_link_click: function(item) {
......
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