Skip to content
Snippets Groups Projects
Commit 99a3fe8a authored by Henrik Askjer's avatar Henrik Askjer
Browse files

load new articles after scrolling one screen height

parent 20f9d764
No related branches found
No related tags found
No related merge requests found
...@@ -332,6 +332,7 @@ export default { ...@@ -332,6 +332,7 @@ export default {
}, },
update_lang_form: function (lang) { update_lang_form: function (lang) {
this.lang = lang this.lang = lang
this.max_scroll = window.window.innerHeight
let name = null let name = null
let query = null let query = null
if(this.$route.name == 'word') { if(this.$route.name == 'word') {
...@@ -430,7 +431,7 @@ export default { ...@@ -430,7 +431,7 @@ export default {
window.onscroll = () => { window.onscroll = () => {
console.log(document.body.scrollHeight - window.window.innerHeight) console.log(document.body.scrollHeight - window.window.innerHeight)
console.log("yof, max",window.pageYOffset, this.max_scroll) 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 this.max_scroll = document.body.scrollHeight - window.window.innerHeight-1
console.log("MAX", this.max_scroll) console.log("MAX", this.max_scroll)
let offset = 10 * this.page let offset = 10 * this.page
......
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