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

Merge branch 'reload_lang_change' into 'master'

Reload lang change

See merge request spraksamlingane/beta.ordbok.uib.no!11
parents bb49b3ca 2ca700d0
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
<main>
<div class="search_container">
<div class="lang_select_container">
<v-radio-group row v-model="lang">
<v-radio-group row v-model="lang" @change="force_rerender">
<template v-slot:label>
<span>VIS</span>
</template>
......@@ -37,6 +37,7 @@
</div>
<SearchResults :hits="search_results"
:lang="lang"
:key="lang"
@article-click="article_link_click"
@details-click="details_click"
v-if="search_results.length && ! waiting && ! article" />
......@@ -177,7 +178,8 @@ export default {
article: null,
error: null,
monthly_bm: null,
monthly_nn: null
monthly_nn: null,
event: null
}
},
computed: {
......@@ -195,9 +197,11 @@ export default {
},
methods: {
select_result: function(event) {
this.event = event
if(event.articles){
let source = '/' + this.lang + '/w/' + event.word
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.article = null
this.error = null
......@@ -211,6 +215,15 @@ export default {
this.$plausible.trackEvent('dropdown selection', {props: {query: event.label, match: '<fritekstsøk>'}})
}
},
force_rerender: function(event) {
if (this.event){
this.event.articles = null
this.select_result(this.event)
}
else{
navigate_to_search(this, this.$router.history.current.params.word)
}
},
article_link_click: function(item) {
if (this.article && this.article.article_id == item.article_id){
this.article_key++
......
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