Skip to content
Snippets Groups Projects
Commit 93e2b7b5 authored by Henrik Askjer's avatar Henrik Askjer
Browse files

Replace suggestion api

parent bba216e9
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
if (item) { if (item) {
if (typeof item != 'string') { if (typeof item != 'string') {
let self = this let self = this
/*
if (item.articles) { if (item.articles) {
axios.get(self.endpoint + 'articles?', {params: {lord: item.match, axios.get(self.endpoint + 'articles?', {params: {lord: item.match,
dict: self.$parent.lang}}) dict: self.$parent.lang}})
...@@ -80,6 +81,7 @@ ...@@ -80,6 +81,7 @@
} }
) )
} }
*/
this.items = [] this.items = []
this.suggesting = false this.suggesting = false
......
...@@ -205,19 +205,22 @@ export default { ...@@ -205,19 +205,22 @@ export default {
if(event.articles){ if(event.articles){
let source = '/' + this.lang + '/w/' + event.match let source = '/' + this.lang + '/w/' + event.match
this.$router.push(source) this.$router.push(source)
/*
this.search_results = event.articles.map(a => Object.assign(a, {source: source})) this.search_results = event.articles.map(a => Object.assign(a, {source: source}))
this.article = null this.article = null
this.error = 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}, '') 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) 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{ }else{
this.waiting_for_articles = true this.waiting_for_articles = true
this.article = null this.article = null
this.$router.push(`/${this.lang}/search/${event.q}`) this.$router.push(`/${this.lang}/search/${event.q}`)
navigate_to_search(this, 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) { update_lang_form: function(event) {
......
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