From ae58c106b7bab479b17baeb5e5325803907d3641 Mon Sep 17 00:00:00 2001
From: Henrik Askjer <henrik.askjer@uib.no>
Date: Mon, 10 Jan 2022 12:06:29 +0100
Subject: [PATCH] move scroll reset to click functions

---
 src/components/DictionaryView.vue | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/components/DictionaryView.vue b/src/components/DictionaryView.vue
index 5cf68707..0fa3178b 100644
--- a/src/components/DictionaryView.vue
+++ b/src/components/DictionaryView.vue
@@ -486,6 +486,9 @@ export default {
       if (this.article && this.article.article_id == item.article_id){
         this.article_key++
         this.replace_history()
+        if (!this.$route.hash) {
+          window.scrollTo(0,0)
+        }
 
       }else{
         navigate_to_article(this, item.source)
@@ -494,15 +497,15 @@ export default {
     details_click: function(item) {
       this.article = item.article
       this.replace_history()
+      if (!this.$route.hash) {
+          window.scrollTo(0,0)
+      }
     },
     return_to_results: function() {
       this.article = null
     }
   },
   mounted: function(){
-    if (!this.$route.hash) {
-      window.scrollTo(0,0)
-    }
 
 
     let self = this
-- 
GitLab