diff --git a/src/components/Autocomplete.vue b/src/components/Autocomplete.vue index 5ea7c13a3b0fa38c1ca29e1d5a3a60d314472b05..725f182731a9d80479c807c811ecf1f21074f0bb 100644 --- a/src/components/Autocomplete.vue +++ b/src/components/Autocomplete.vue @@ -63,6 +63,7 @@ if (item) { if (typeof item != 'string') { let self = this + /* if (item.articles) { axios.get(self.endpoint + 'articles?', {params: {lord: item.match, dict: self.$parent.lang}}) @@ -80,6 +81,7 @@ } ) } + */ this.items = [] this.suggesting = false diff --git a/src/components/DictionaryView.vue b/src/components/DictionaryView.vue index 6182d3b0cadcfb95cc7a61a1c92fb54ecc9bdac7..91fbd67b5b692896332ce68554cd3d91c65ff3d4 100644 --- a/src/components/DictionaryView.vue +++ b/src/components/DictionaryView.vue @@ -205,19 +205,22 @@ export default { if(event.articles){ let source = '/' + this.lang + '/w/' + event.match this.$router.push(source) + /* this.search_results = event.articles.map(a => Object.assign(a, {source: source})) this.article = null this.error = null - this.waiting_for_articles = true + history.replaceState({article: this.article, search_results: this.search_results, lang: this.lang, error: this.error}, '') + */ + this.waiting_for_articles = true navigate_to_word(this, event.match) - this.$plausible.trackEvent('dropdown selection', {props: {query: event.label, match: event.match}}) + this.$plausible.trackEvent('dropdown selection', {props: {query: event.q, match: event.match}}) }else{ this.waiting_for_articles = true this.article = null this.$router.push(`/${this.lang}/search/${event.q}`) navigate_to_search(this, event.q) - this.$plausible.trackEvent('dropdown selection', {props: {query: event.label, match: '<fritekstsøk>'}}) + this.$plausible.trackEvent('dropdown selection', {props: {query: event.q, match: '<fritekstsøk>'}}) } }, update_lang_form: function(event) {