|
|
@@ -9,7 +9,10 @@
|
|
9
|
9
|
h3 sorted {{ sortBy.replace('-', ' ') }}
|
|
10
|
10
|
|
|
11
|
11
|
h3(v-if="!loaded") loading...
|
|
12
|
|
- .content(v-else-if="allPagesLoaded && type && allPages[type]" v-html="allPages[type].content")
|
|
|
12
|
+ .content(
|
|
|
13
|
+ v-else-if="allPagesLoaded && type && allPages[type]"
|
|
|
14
|
+ v-html="allPages[type].content"
|
|
|
15
|
+ )
|
|
13
|
16
|
|
|
14
|
17
|
.posts(v-if="posts && loaded" :class="{ 'is-grid': grid }")
|
|
15
|
18
|
section(v-for="(post, i) in posts" :key="post.slug").shadow.post
|
|
|
@@ -97,8 +100,8 @@ export default {
|
|
97
|
100
|
async getPosts({ clear }) {
|
|
98
|
101
|
const dispatchAction = clear ? `getAll${this.pType}` : `getMore${this.pType}`
|
|
99
|
102
|
// pType sometimes is undefined so need to dispatch and
|
|
100
|
|
- // Episodes only needs load call
|
|
101
|
103
|
let res = null
|
|
|
104
|
+ // Episodes only needs load call
|
|
102
|
105
|
if(this.pType && dispatchAction != `getMoreEpisodes`) {
|
|
103
|
106
|
console.log('d:', dispatchAction, this._getDispatchParams())
|
|
104
|
107
|
res = await this.$store.dispatch(dispatchAction, this._getDispatchParams())
|
|
|
@@ -116,7 +119,10 @@ export default {
|
|
116
|
119
|
this._clearHero(this.$store)
|
|
117
|
120
|
|
|
118
|
121
|
if (!this['allPagesLoaded']) {
|
|
119
|
|
- await this.$store.dispatch('getAllPages', { sortType: null, params: null })
|
|
|
122
|
+ await this.$store.dispatch('getAllPages', {
|
|
|
123
|
+ sortType: null,
|
|
|
124
|
+ params: null
|
|
|
125
|
+ })
|
|
120
|
126
|
}
|
|
121
|
127
|
|
|
122
|
128
|
// We always set a hero no matter what
|
|
|
@@ -133,6 +139,7 @@ export default {
|
|
133
|
139
|
setIntersectionLoader() {
|
|
134
|
140
|
console.warn('setting up intersection handler for:', this.type)
|
|
135
|
141
|
window.removeEventListener("load", e => {}, false)
|
|
|
142
|
+ console.warn('all intersection handlers:', window)
|
|
136
|
143
|
const footerEl = document.querySelector(".footer-wrapper footer")
|
|
137
|
144
|
if(!footerEl) return
|
|
138
|
145
|
|
|
|
@@ -146,22 +153,16 @@ export default {
|
|
146
|
153
|
},
|
|
147
|
154
|
watch: {
|
|
148
|
155
|
$route(to, from) {
|
|
149
|
|
- // Filter the path to remove blank strings and
|
|
150
|
|
- // only grab the hero if moving to another list page
|
|
151
|
|
- // eg. list page -> list page
|
|
152
|
|
- // const path = to.fullPath.split('/').filter(p => p)
|
|
153
|
|
- // console.log('to:', path)
|
|
154
|
|
- // console.log('?:', path.pop())
|
|
155
|
|
- // console.log('?:', path.pop())
|
|
156
|
|
-
|
|
157
|
|
- // Always reset the page count
|
|
|
156
|
+ // Always reset the page count & fetch flag
|
|
|
157
|
+ console.log('route to:', to)
|
|
|
158
|
+ console.log('route from:', from)
|
|
158
|
159
|
this.page = 0
|
|
159
|
|
-
|
|
|
160
|
+ this.keepFetching = true
|
|
160
|
161
|
this.setIntersectionLoader()
|
|
161
|
162
|
},
|
|
162
|
163
|
},
|
|
163
|
164
|
created() {
|
|
164
|
|
- console.log('--- liiiist ---')
|
|
|
165
|
+ console.log('--- List page ---')
|
|
165
|
166
|
this.setIntersectionLoader()
|
|
166
|
167
|
},
|
|
167
|
168
|
}
|