|
|
@@ -34,6 +34,9 @@ import { postTypes, sortTypes, convertTitleCase } from '@/utils/helpers'
|
|
34
|
34
|
|
|
35
|
35
|
const TIMEOUT = 1
|
|
36
|
36
|
const INTERSECT_SELECTOR = '.page--list > article footer'
|
|
|
37
|
+const wideTypes = ['event', 'exhibition']
|
|
|
38
|
+const gridTypes = ['episode', 'artist']
|
|
|
39
|
+const sansSidebarTypes = ['episode']
|
|
37
|
40
|
|
|
38
|
41
|
export default {
|
|
39
|
42
|
components: { sidebar, featuredImage, card },
|
|
|
@@ -48,15 +51,31 @@ export default {
|
|
48
|
51
|
}
|
|
49
|
52
|
},
|
|
50
|
53
|
computed: {
|
|
51
|
|
- type: () => this.$route.params.type,
|
|
52
|
|
- sortBy: () => this.$route.params.sortBy,
|
|
53
|
|
- grid: () => this.type ? ['episode', 'artist'].includes(this.type) : null,
|
|
54
|
|
- isWide: () => this.type ? ['event', 'exhibition'].includes(this.type) : null,
|
|
55
|
|
- sidebar: () => this.type ? !['episode'].includes(this.type) : null,
|
|
56
|
|
- shouldLoadAllAtOnce: () => this.type == 'episode' || this.type == 'artist' && this.sortBy == sortTypes.material,
|
|
57
|
|
- pType: () => this.type ? `${convertTitleCase(this.type)}s` : null,
|
|
58
|
|
- loaded: () => this.pType ? this[`all${this.pType}Loaded`] : false,
|
|
59
|
|
- posts: () => this.pType ? this[`all${this.pType}`] : []
|
|
|
54
|
+ grid: () => this.type ? gridTypes.includes(this.type) : null,
|
|
|
55
|
+ isWide: () => this.type ? wideTypes.includes(this.type) : null,
|
|
|
56
|
+ sidebar: () => this.type ? !sansSidebarTypes.includes(this.type) : null,
|
|
|
57
|
+ type() {
|
|
|
58
|
+ // Checks for type and fixes Episodes route edge case
|
|
|
59
|
+ return this.$route.params.type
|
|
|
60
|
+ },
|
|
|
61
|
+ sortBy() {
|
|
|
62
|
+ return this.$route.params.sortBy
|
|
|
63
|
+ },
|
|
|
64
|
+ pType() {
|
|
|
65
|
+ if(!this.type) return
|
|
|
66
|
+ return `${convertTitleCase(this.type)}s`
|
|
|
67
|
+ },
|
|
|
68
|
+ loaded() {
|
|
|
69
|
+ if (!this.pType) return
|
|
|
70
|
+ return this[`all${this.pType}Loaded`]
|
|
|
71
|
+ },
|
|
|
72
|
+ posts() {
|
|
|
73
|
+ if (!this.pType) return
|
|
|
74
|
+ return this[`all${this.pType}`]
|
|
|
75
|
+ },
|
|
|
76
|
+ shouldLoadAllAtOnce() {
|
|
|
77
|
+ return this.type == 'episode' || this.type == 'artist' && this.sortBy == sortTypes.material
|
|
|
78
|
+ }
|
|
60
|
79
|
},
|
|
61
|
80
|
methods: {
|
|
62
|
81
|
async loadMorePosts(shouldClear) {
|