|
|
@@ -17,11 +17,12 @@
|
|
17
|
17
|
.posts(v-if="posts && loaded" :class="{ 'is-grid': grid }")
|
|
18
|
18
|
section(v-for="(post, i) in posts" :key="post.slug").shadow.post
|
|
19
|
19
|
card(:content="post" :type="type" :wide="type == 'exhibition' && i > 1 || type == 'event' && i > 1 ")
|
|
20
|
|
-
|
|
|
20
|
+
|
|
|
21
|
+ //- Important: Do NOT remove this! Required for intersection observer
|
|
21
|
22
|
footer
|
|
22
|
23
|
p(v-if="loadingFetched") loading more {{ type }}...
|
|
23
|
|
- p {{ `${type} count: ${Object.values(posts).length}` }}
|
|
24
|
|
- p {{ `show sidebar: ${sidebar}` }}
|
|
|
24
|
+ p(v-if="showMeta") {{ `${type} count: ${Object.values(posts).length}` }}
|
|
|
25
|
+ p(v-if="showMeta") {{ `show sidebar: ${sidebar}` }}
|
|
25
|
26
|
|
|
26
|
27
|
sidebar(v-if="sidebar" :type="`${type}`" layout="list")
|
|
27
|
28
|
</template>
|
|
|
@@ -35,7 +36,8 @@ import { postTypeGetters, scrollTop, heroUtils } from './mixin-post-types'
|
|
35
|
36
|
import { postTypes, convertTitleCase, typeFromRoute } from '@/utils/helpers'
|
|
36
|
37
|
|
|
37
|
38
|
const TIMEOUT = 1
|
|
38
|
|
-const INTERSECT_SELECTOR = ".page--list > article footer"
|
|
|
39
|
+const INTERSECT_SELECTOR = '.page--list > article footer'
|
|
|
40
|
+
|
|
39
|
41
|
export default {
|
|
40
|
42
|
components: { sidebar, featuredImage, card },
|
|
41
|
43
|
props: {
|
|
|
@@ -46,6 +48,7 @@ export default {
|
|
46
|
48
|
mixins: [postTypeGetters, scrollTop, heroUtils],
|
|
47
|
49
|
data() {
|
|
48
|
50
|
return {
|
|
|
51
|
+ showMeta:false,
|
|
49
|
52
|
page: 0,
|
|
50
|
53
|
perPage: 21,
|
|
51
|
54
|
keepFetching: true,
|
|
|
@@ -78,12 +81,10 @@ export default {
|
|
78
|
81
|
this.$store.commit(`${uppercaseType}_LOADED`)
|
|
79
|
82
|
},
|
|
80
|
83
|
async loadMorePosts() {
|
|
81
|
|
- console.log('trying to load for: ', this.$route)
|
|
82
|
84
|
const type = typeFromRoute(this.$route)
|
|
83
|
85
|
if(!type) return console.warn(`type: ${type} not found...`)
|
|
84
|
86
|
if(!this.keepFetching) return console.warn('nothing left to fetch...')
|
|
85
|
87
|
|
|
86
|
|
- console.warn(`loading more ${type} posts...`)
|
|
87
|
88
|
this.loadingFetched = true
|
|
88
|
89
|
console.warn(
|
|
89
|
90
|
`loading page ${this.page + 1} of ${type} posts:
|
|
|
@@ -189,10 +190,7 @@ export default {
|
|
189
|
190
|
watch: {
|
|
190
|
191
|
// This only fires navigating from
|
|
191
|
192
|
// a list page, to another list page
|
|
192
|
|
- type(newType, oldType){
|
|
193
|
|
- console.log('old:', oldType)
|
|
194
|
|
- console.log('new:', newType)
|
|
195
|
|
-
|
|
|
193
|
+ type(newType, oldType) {
|
|
196
|
194
|
if(!postTypes.includes(newType)) return console.warn('type not found...')
|
|
197
|
195
|
this.setIntersectionLoader()
|
|
198
|
196
|
this.clearAndInitPostList()
|