|
|
@@ -40,7 +40,7 @@ export default {
|
|
40
|
40
|
grid: { type: Boolean },
|
|
41
|
41
|
sortBy: { type: String },
|
|
42
|
42
|
},
|
|
43
|
|
- mixins: [postTypeGetters, scrollTop],
|
|
|
43
|
+ mixins: [postTypeGetters, scrollTop, heroUtils],
|
|
44
|
44
|
data() {
|
|
45
|
45
|
return {
|
|
46
|
46
|
page: 0,
|
|
|
@@ -71,7 +71,7 @@ export default {
|
|
71
|
71
|
// console.log(this.$route)
|
|
72
|
72
|
const type = typeFromRoute(this.$route)
|
|
73
|
73
|
if(!type) return console.warn(`type: ${type} not found...`)
|
|
74
|
|
- if(!keepFetching) return console.warn('nothing left to fetch...')
|
|
|
74
|
+ if(!this.keepFetching) return console.warn('nothing left to fetch...')
|
|
75
|
75
|
|
|
76
|
76
|
console.warn(`loading more ${type} posts...`)
|
|
77
|
77
|
this.page++
|
|
|
@@ -109,27 +109,10 @@ export default {
|
|
109
|
109
|
this.keepFetching = false
|
|
110
|
110
|
}
|
|
111
|
111
|
},
|
|
112
|
|
- _clearHero() {
|
|
113
|
|
- this.$store.commit('SET_HERO', { url: null, heroType: null })
|
|
114
|
|
- },
|
|
115
|
|
- _setHeroInfo(page) {
|
|
116
|
|
- let json = { url: page.featured, heroType:'image' }
|
|
117
|
|
- if (
|
|
118
|
|
- page.hero &&
|
|
119
|
|
- JSON.parse(page.hero) &&
|
|
120
|
|
- JSON.parse(page.hero).url
|
|
121
|
|
- ) {
|
|
122
|
|
- json = JSON.parse(page.hero)
|
|
123
|
|
- json.heroType = 'video'
|
|
124
|
|
- }
|
|
125
|
|
- // No featured or youTube
|
|
126
|
|
- if (!json.url) { json.heroType = null }
|
|
127
|
|
- // Set the hero text to the post title or excerpt
|
|
128
|
|
- json.text = page && page.excerpt ? page.excerpt : page.title
|
|
129
|
|
- return json
|
|
130
|
|
- },
|
|
|
112
|
+ // _setHeroInfo(post) {} from mixin
|
|
|
113
|
+ // _clearHero(store) {} from mixin
|
|
131
|
114
|
async checkAndSetHero(type) {
|
|
132
|
|
- this._clearHero()
|
|
|
115
|
+ this._clearHero(this.$store)
|
|
133
|
116
|
|
|
134
|
117
|
if (!this['allPagesLoaded']) {
|
|
135
|
118
|
await this.$store.dispatch('getAllPages', { sortType: null, params: null })
|