|
|
@@ -145,23 +145,17 @@ export default {
|
|
145
|
145
|
this.$store.commit('SET_HERO', this._setHeroInfo(page))
|
|
146
|
146
|
},
|
|
147
|
147
|
setIntersectionLoader() {
|
|
148
|
|
- if(!this.type) return console.error('cannot setup interseciton handler for undefined type')
|
|
|
148
|
+ if(!this.type) return console.error('cannot setup intersection handler for undefined type')
|
|
|
149
|
+ if(this.type == 'episode') return console.warn('intersection handler not setup for episode')
|
|
149
|
150
|
|
|
150
|
151
|
console.warn('setting up intersection handler for:', this.type)
|
|
151
|
152
|
const footerEl = document.querySelector(INTERSECT_SELECTION)
|
|
152
|
|
- // console.warn('found el: ',footerEl)
|
|
153
|
153
|
if(!footerEl) return
|
|
154
|
|
- // console.warn('attach to: ',footerEl)
|
|
155
|
154
|
|
|
156
|
155
|
const onIntersect = (entries, observer) => {
|
|
157
|
|
- console.log('intersection handler fired...')
|
|
158
|
|
- entries.forEach(entry => {
|
|
159
|
|
- if (!entry.isIntersecting || this.loadingFetched) return
|
|
160
|
|
- console.log("intersected:", entry)
|
|
161
|
|
- setTimeout(() => {
|
|
162
|
|
- this.loadMorePosts()
|
|
163
|
|
- }, 1000)
|
|
164
|
|
- })
|
|
|
156
|
+ // console.log('intersection handler fired...')
|
|
|
157
|
+ if (this.loadingFetched) return
|
|
|
158
|
+ setTimeout(this.loadMorePosts, TIMEOUT)
|
|
165
|
159
|
}
|
|
166
|
160
|
this.observer = new IntersectionObserver(onIntersect, {
|
|
167
|
161
|
threshold: 0.80
|