From 99a3fe8ab3c37914d19d2834c89db658edb4c6fd Mon Sep 17 00:00:00 2001
From: Henrik Askjer <henrik.askjer@uib.no>
Date: Tue, 16 Nov 2021 17:21:35 +0100
Subject: [PATCH] load new articles after scrolling one screen height

---
 src/components/DictionaryView.vue | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/components/DictionaryView.vue b/src/components/DictionaryView.vue
index 5124f34f..a7bcda16 100644
--- a/src/components/DictionaryView.vue
+++ b/src/components/DictionaryView.vue
@@ -332,6 +332,7 @@ export default {
       },
       update_lang_form: function (lang) {
         this.lang = lang
+        this.max_scroll = window.window.innerHeight
         let name = null
         let query = null
         if(this.$route.name == 'word') {
@@ -430,7 +431,7 @@ export default {
     window.onscroll = () => {
       console.log(document.body.scrollHeight - window.window.innerHeight)
       console.log("yof, max",window.pageYOffset, this.max_scroll)
-    if (window.pageYOffset > this.max_scroll && window.pageYOffset > (document.body.scrollHeight - window.window.innerHeight * 2)) {
+    if (window.pageYOffset > this.max_scroll && window.pageYOffset > window.window.innerHeight) {
       this.max_scroll = document.body.scrollHeight - window.window.innerHeight-1
       console.log("MAX", this.max_scroll)
       let offset = 10 * this.page
-- 
GitLab