|
|
@@ -47,7 +47,7 @@ export default {
|
|
47
|
47
|
data() {
|
|
48
|
48
|
return {
|
|
49
|
49
|
page: 0,
|
|
50
|
|
- perPage: 18,
|
|
|
50
|
+ perPage: 6,
|
|
51
|
51
|
keepFetching: true
|
|
52
|
52
|
}
|
|
53
|
53
|
},
|
|
|
@@ -76,7 +76,7 @@ export default {
|
|
76
|
76
|
this.$store.commit(`${uppercaseType}_LOADED`)
|
|
77
|
77
|
},
|
|
78
|
78
|
loadMorePosts() {
|
|
79
|
|
- // console.log(this.$route)
|
|
|
79
|
+ console.log('trying to load for: ', this.$route)
|
|
80
|
80
|
const type = typeFromRoute(this.$route)
|
|
81
|
81
|
if(!type) return console.warn(`type: ${type} not found...`)
|
|
82
|
82
|
if(!this.keepFetching) return console.warn('nothing left to fetch...')
|
|
|
@@ -144,14 +144,15 @@ export default {
|
|
144
|
144
|
|
|
145
|
145
|
console.warn('setting up intersection handler for:', this.type)
|
|
146
|
146
|
const footerEl = document.querySelector(".footer-wrapper footer")
|
|
147
|
|
- console.warn('attach to: ',footerEl)
|
|
|
147
|
+ // console.warn('attach to: ',footerEl)
|
|
148
|
148
|
if(!footerEl) return
|
|
149
|
149
|
|
|
150
|
150
|
window.addEventListener("load", e => {
|
|
151
|
151
|
const onIntersection = () => {
|
|
152
|
152
|
console.log('intersected...')
|
|
153
|
153
|
this.loadMorePosts()
|
|
154
|
|
- console.log('loaded morePosts...')
|
|
|
154
|
+ console.log('loaded...', this.loadMorePosts)
|
|
|
155
|
+ console.log('cb this:', this)
|
|
155
|
156
|
}
|
|
156
|
157
|
const observer = new IntersectionObserver(onIntersection, {
|
|
157
|
158
|
rootMargin: "0px 0px -20px 0px",
|