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

tracker klikk på referanser

parent 933894dd
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,11 @@ window.onpopstate = function (event) {
}
}
function navigate_to_article(self, article_id) {
function navigate_to_article(self, article_id, origin_article, origin_lemma) {
if (origin_article) {
self.$plausible.trackEvent('internal link incoming', {props: {origin: `${self.$route.params.lang}/${origin_article}/${origin_lemma || '_'}`}})
}
axios.get(self.api_pref + '' + article_id)
.then(function(response){
self.article = response.data
......@@ -171,9 +175,11 @@ export default {
this.article_key++
history.replaceState({article: this.article, search_results: this.search_results, lang: this.lang}, '')
}else{
let current_art_id = this.article.article_id
let current_lemma = this.article.lemmas[0].lemma
this.article = {lemmas: [], body:{pronunciation: [], definitions: [], etymology: []}}
this.waiting_for_articles = true
navigate_to_article(this, item.article_id)
navigate_to_article(this, item.article_id, current_art_id, current_lemma)
}
},
search_hit_click: function(article){
......
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