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

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

diff --git a/src/components/DictionaryView.vue b/src/components/DictionaryView.vue
index 9ba41a11..e6d59953 100644
--- a/src/components/DictionaryView.vue
+++ b/src/components/DictionaryView.vue
@@ -434,6 +434,12 @@ export default {
     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)
+
+      this.max_scroll += window.window.innerHeight
+      if (this.max_scroll > document.body.scrollHeight - window.window.innerHeight-1) {
+        this.max_scroll = document.body.scrollHeight - window.window.innerHeight-1
+      }
+
       let offset = 10 * this.page
       this.page += 1
       if (!self.waiting_for_articles) {
-- 
GitLab