|
|
@@ -187,24 +187,22 @@ export default {
|
|
187
|
187
|
}
|
|
188
|
188
|
|
|
189
|
189
|
if (!this[`all${type}Loaded`] || sort) this.getPosts(true)
|
|
|
190
|
+
|
|
|
191
|
+ // Add the infinite scroll load
|
|
|
192
|
+ window.removeEventListener("load", e => {}, false)
|
|
|
193
|
+ window.addEventListener("load", e => {
|
|
|
194
|
+ const footerEl = document.querySelector(".footer-wrapper footer")
|
|
|
195
|
+ const observer = new IntersectionObserver(this.loadMorePosts, {
|
|
|
196
|
+ rootMargin: "0px 0px -20px 0px",
|
|
|
197
|
+ })
|
|
|
198
|
+ observer.observe(footerEl)
|
|
|
199
|
+ }, false)
|
|
190
|
200
|
},
|
|
191
|
201
|
},
|
|
192
|
202
|
mounted() {
|
|
193
|
203
|
if (this.$route.hash) {
|
|
194
|
204
|
setTimeout(() => this.scrollTo(this.$route.hash), TIMEOUT)
|
|
195
|
205
|
}
|
|
196
|
|
-
|
|
197
|
|
- // Add the infinite scroll load
|
|
198
|
|
- window.addEventListener("load", e => {
|
|
199
|
|
- const footerEl = document.querySelector(".footer-wrapper footer")
|
|
200
|
|
- const observer = new IntersectionObserver(this.loadMorePosts, {
|
|
201
|
|
- rootMargin: "0px 0px 50px 0px",
|
|
202
|
|
- })
|
|
203
|
|
- observer.observe(footerEl)
|
|
204
|
|
- }, false)
|
|
205
|
|
- },
|
|
206
|
|
- unmounted() {
|
|
207
|
|
- window.removeEventListener("load", e => {}, false)
|
|
208
|
206
|
},
|
|
209
|
207
|
created() {
|
|
210
|
208
|
let type = convertTitleCase(this.type) + 's'
|