Fix scrolling

This commit is contained in:
Peter Stuifzand 2018-09-01 21:49:32 +02:00
parent d88f7ab1d9
commit 7845004840

View File

@ -59,11 +59,8 @@
.then(() => {
item._is_read = true
})
}
},
mounted() {
window.onscroll = () => {
},
handleScroll() {
// let bottomOfWindow = document.documentElement.scrollTop + window.innerHeight === document.documentElement.offsetHeight;
let bottomOfWindow = document.documentElement.scrollTop + window.innerHeight === this.$el.offsetHeight + document.documentElement.offsetHeight + 20;
if (bottomOfWindow) {
@ -94,6 +91,14 @@
}
})
}
},
created() {
window.addEventListener('scroll', this.handleScroll);
},
destroyed() {
window.removeEventListener('scroll', this.handleScroll);
}
}
</script>