|
|
@@ -5,10 +5,18 @@
|
|
5
|
5
|
article.f-grow.shadow
|
|
6
|
6
|
header
|
|
7
|
7
|
h1 {{ type }}:{{ $route.params.slug }} single
|
|
|
8
|
+ p {{galleries}}
|
|
|
9
|
+ p categories:
|
|
|
10
|
+ span(v-for="category in posts[$route.params.slug].categories") {{ category }}
|
|
8
|
11
|
section(v-if="posts[$route.params.slug]")
|
|
9
|
12
|
h4 {{ posts[$route.params.slug].title }}
|
|
10
|
|
- .block-wrapper(v-for="block in posts[$route.params.slug].blocks" v-html="block")
|
|
11
|
|
-
|
|
|
13
|
+ .block-wrapper(v-for="block in posts[$route.params.slug].blocks")
|
|
|
14
|
+ .block(v-if="typeof block === 'object'")
|
|
|
15
|
+ p gallery {{ block.gallery + 1 }}:
|
|
|
16
|
+ ul
|
|
|
17
|
+ li(v-for="imageID in posts[$route.params.slug].galleries[block.gallery].ids") image: {{ imageID }}
|
|
|
18
|
+ .block(v-else v-html="block")
|
|
|
19
|
+
|
|
12
|
20
|
sidebar(v-if="sidebar" :type="`${type}`")
|
|
13
|
21
|
.shadow
|
|
14
|
22
|
h1.t-up single slot
|
|
|
@@ -53,6 +61,10 @@ export default {
|
|
53
|
61
|
type() { // Checks for type and fixes Episodes route edge case
|
|
54
|
62
|
return typeFromRoute(this.$route)
|
|
55
|
63
|
},
|
|
|
64
|
+ galleries() {
|
|
|
65
|
+ if(!this.posts || !this.$route || !this.posts[this.$route.params.slug]) return
|
|
|
66
|
+ return this.posts[this.$route.params.slug].galleries[block.gallery].ids
|
|
|
67
|
+ },
|
|
56
|
68
|
posts() {
|
|
57
|
69
|
let type = convertTitleCase(this.type)
|
|
58
|
70
|
|
|
|
@@ -100,28 +112,12 @@ export default {
|
|
100
|
112
|
this.checkForImages(newVal)
|
|
101
|
113
|
|
|
102
|
114
|
this.checkAndSetHero(newVal)
|
|
103
|
|
-
|
|
104
|
|
- // Gottas be on the next render tick
|
|
105
|
|
- this.$nextTick(() => {
|
|
106
|
|
- let gallery
|
|
107
|
|
- this.pageBlocks(newVal).forEach(block => {
|
|
108
|
|
- if(!block) return
|
|
109
|
|
- gallery = document.querySelectorAll('.blocks-gallery-item figure')
|
|
110
|
|
- })
|
|
111
|
|
-
|
|
112
|
|
- if(!gallery || gallery.length < 1) return
|
|
113
|
|
-
|
|
114
|
|
- gallery.forEach((item, i) => {
|
|
115
|
|
- item.addEventListener('mouseup', event => {
|
|
116
|
|
- this.fullscreengallery = i
|
|
117
|
|
- })
|
|
118
|
|
- })
|
|
119
|
|
- })
|
|
120
|
|
-
|
|
|
115
|
+ console.log(this.galleries)
|
|
121
|
116
|
}
|
|
122
|
117
|
},
|
|
123
|
118
|
created() {
|
|
124
|
119
|
let type = convertTitleCase(this.$route.params.type)
|
|
|
120
|
+
|
|
125
|
121
|
if(!this[`all{type}Loaded`]) {
|
|
126
|
122
|
// console.log('Retrieving...', type)
|
|
127
|
123
|
this.$store.dispatch(`getAll${type}`)
|