Skip to content
Snippets Groups Projects
Commit 0f6cf3df authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

tar ikke med målformene i URL (dropdown-valg)

parent 16cfe72c
No related branches found
No related tags found
No related merge requests found
......@@ -148,15 +148,15 @@ export default {
function(response) {
let hits = q.length ? [{q: q, label: q + ' (fritekstsøk)'}] : []
response.data.forEach((item, i) => {
if (! hits[0] || hits[0].label != item.match) {
hits.splice(0, 0, {q: q, lang_set: new Set(), label: item.match, articles: []})
if (! hits[0] || hits[0].word != item.match) {
hits.splice(0, 0, {q: q, lang_set: new Set(), word: item.match, articles: []})
}
hits[0].lang_set.add(item.dictionary == 'bob' ? 'bm' : 'nn')
hits[0].articles.push(item)
});
hits.forEach(function (hit) {
if (hit.lang_set) {
hit.label += ` (${Array.from(hit.lang_set).join(', ')})`
hit.label = `${hit.word} (${Array.from(hit.lang_set).join(', ')})`
}
});
hits.reverse()
......@@ -177,7 +177,7 @@ export default {
this.$refs.search.value = ''
document.activeElement.blur()
if(event.articles){
this.$router.push('/' + this.lang + '/w/' + event.label)
this.$router.push('/' + this.lang + '/w/' + event.word)
this.search_results = event.articles
this.article = {lemmas: [], body:{pronunciation: [], definitions: [], etymology: []}}
history.replaceState({article: this.article, search_results: this.search_results, lang: this.lang}, '')
......
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