From b642da0749ae69336671110a2ea7d37cdb37c042 Mon Sep 17 00:00:00 2001 From: "Henrik.Askjer" <henrik.askjer@uib.no> Date: Tue, 14 Sep 2021 10:34:09 +0200 Subject: [PATCH] Sak 416 --- src/components/Autocomplete.vue | 2 +- src/components/DictionaryView.vue | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/components/Autocomplete.vue b/src/components/Autocomplete.vue index 1ac5facb..c7a588ff 100644 --- a/src/components/Autocomplete.vue +++ b/src/components/Autocomplete.vue @@ -103,7 +103,7 @@ let match = item[0] let hit = {q: q, match: match, label: match, time: time} - hit.article_promise = self.api.get('articles?', {params: {lord: match, dict: self.$parent.lang}}) + hit.article_promise = self.api.get('articles?', {params: {lord: match}}) hit.lang = item[1] hits.push(hit) diff --git a/src/components/DictionaryView.vue b/src/components/DictionaryView.vue index d4e73abd..916799ec 100644 --- a/src/components/DictionaryView.vue +++ b/src/components/DictionaryView.vue @@ -219,10 +219,13 @@ export default { this.$router.push(source) let unwrapped = [] for (const d in event.article_ids) { - event.article_ids[d].forEach(i => unwrapped.push({ - dictionary: d, - id: i - })) + if (d == this.lang || this.lang == "bob,nob") { + event.article_ids[d].forEach(i => unwrapped.push({ + dictionary: d, + id: i + })) + } + } let self = this @@ -265,9 +268,6 @@ export default { error: self.error }, '') }) - - - } else { this.waiting_for_articles = true this.article = null @@ -282,11 +282,10 @@ export default { } }, update_lang_form: function (event) { - if (this.event) { + this.lang = event + if (this.event && !this.article) { this.event.articles = null this.select_result(this.event) - } else { - navigate_to_search(this, this.$router.history.current.params.word || this.$router.history.current.params.query) } }, article_link_click: function(item) { -- GitLab