|
|
@@ -8,7 +8,7 @@
|
|
8
|
8
|
|
|
9
|
9
|
section(v-if="post")
|
|
10
|
10
|
h4 {{ post.title }}
|
|
11
|
|
- p {{ activeGalleryIndex }}
|
|
|
11
|
+
|
|
12
|
12
|
.block-wrapper(v-for="(block, i) in post.blocks")
|
|
13
|
13
|
//- ?: are objects are always gallery blocks
|
|
14
|
14
|
.gallery.block(v-if="typeof block === 'object'")
|
|
|
@@ -19,20 +19,20 @@
|
|
19
|
19
|
//- Fullscreen gallery
|
|
20
|
20
|
gallery(
|
|
21
|
21
|
v-if="activeGalleryIndex == (i - 1)"
|
|
22
|
|
- :activeGalleryIndex="activeGalleryIndex"
|
|
23
|
22
|
:image-ids="post.galleries[block.gallery].ids"
|
|
24
|
23
|
:activeImageIndex="activeImageIndex"
|
|
25
|
24
|
v-on:close="activeGalleryIndex = -1"
|
|
|
25
|
+ :image-sizes="post.attached"
|
|
26
|
26
|
)
|
|
27
|
27
|
|
|
28
|
28
|
//- Just a regular block
|
|
29
|
29
|
.block(v-else v-html="block")
|
|
30
|
30
|
|
|
31
|
|
- //- sidebar(v-if="sidebar" :type="`${type}`")
|
|
32
|
|
- //- .shadow
|
|
33
|
|
- //- h1.t-up single slot
|
|
34
|
|
- //- div
|
|
35
|
|
- //- p body whatever
|
|
|
31
|
+ sidebar(v-if="sidebar" :type="`${type}`")
|
|
|
32
|
+ .shadow
|
|
|
33
|
+ h1.t-up single slot
|
|
|
34
|
+ div
|
|
|
35
|
+ p body whatever
|
|
36
|
36
|
</template>
|
|
37
|
37
|
|
|
38
|
38
|
<script>
|
|
|
@@ -100,6 +100,14 @@ export default {
|
|
100
|
100
|
|
|
101
|
101
|
const json = JSON.parse(post.hero)
|
|
102
|
102
|
this.$store.commit('SET_HERO', json)
|
|
|
103
|
+ },
|
|
|
104
|
+ async checkAndSetImages(posts) {
|
|
|
105
|
+ const post = posts[this.$route.params.slug]
|
|
|
106
|
+ if(!post || ! post.attached) return
|
|
|
107
|
+
|
|
|
108
|
+ const imagesAttached = post.attached
|
|
|
109
|
+ await this.$store.dispatch(`getMediaById`, imagesAttached)
|
|
|
110
|
+ console.log(this.$store.media)
|
|
103
|
111
|
}
|
|
104
|
112
|
},
|
|
105
|
113
|
watch: {
|
|
|
@@ -108,11 +116,12 @@ export default {
|
|
108
|
116
|
// this.checkForImages(newVal)
|
|
109
|
117
|
|
|
110
|
118
|
this.checkAndSetHero(newVal)
|
|
|
119
|
+ this.checkAndSetImages(newVal)
|
|
111
|
120
|
}
|
|
112
|
121
|
},
|
|
113
|
122
|
created() {
|
|
114
|
123
|
let type = convertTitleCase(this.$route.params.type)
|
|
115
|
|
- this.$store.dispatch(`getMediaById`, [7])
|
|
|
124
|
+
|
|
116
|
125
|
if(!this[`all{type}Loaded`]) {
|
|
117
|
126
|
// console.log('Retrieving...', type)
|
|
118
|
127
|
this.$store.dispatch(`getAll${type}`)
|