From b1509c3f6a4824c36c090c69fc8050d1218821a3 Mon Sep 17 00:00:00 2001
From: Stephan Porada <sporada@uni-bielefeld.de>
Date: Tue, 3 Nov 2020 11:46:37 +0100
Subject: [PATCH] Fix scroll to top

---
 web/app/static/js/modules/corpus_analysis/view/scrollToTop.js | 2 +-
 web/app/templates/corpora/analyse_corpus.html.j2              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/web/app/static/js/modules/corpus_analysis/view/scrollToTop.js b/web/app/static/js/modules/corpus_analysis/view/scrollToTop.js
index 689ea13a..835ab8a0 100644
--- a/web/app/static/js/modules/corpus_analysis/view/scrollToTop.js
+++ b/web/app/static/js/modules/corpus_analysis/view/scrollToTop.js
@@ -15,7 +15,7 @@ function scrollToTop(scrollToElementSelector, triggerElementSelector) {
   scrolltoTopTrigger.onclick = () => {
     scrollToThis.scrollIntoView({
       behavior: 'smooth',
-      block: 'end',
+      block: 'start',
       inline: 'nearest'
     });
   };
diff --git a/web/app/templates/corpora/analyse_corpus.html.j2 b/web/app/templates/corpora/analyse_corpus.html.j2
index e9ca926f..29dba027 100644
--- a/web/app/templates/corpora/analyse_corpus.html.j2
+++ b/web/app/templates/corpora/analyse_corpus.html.j2
@@ -339,7 +339,7 @@ document.addEventListener("DOMContentLoaded", () => {
     client.query(results.data.query);
   });
   // Enable scroll to Top functionality.
-  scrollToTop('#headline', '#menu-scroll-to-top-div');
+  scrollToTop('header', '#menu-scroll-to-top-div');
 });
 </script>
 {% endblock %}
-- 
GitLab