|
|
@@ -14,8 +14,9 @@
|
|
14
|
14
|
//- ?: are objects are always gallery blocks
|
|
15
|
15
|
.gallery.block(v-if="typeof block === 'object'" :class="`gallery-${i}`")
|
|
16
|
16
|
p gallery number: {{ i }}
|
|
17
|
|
- ul.t-cntr
|
|
18
|
|
- li(v-for="(imageID, j) in post.galleries[block.gallery].ids" :class="`gallery-${i}--image-${j+1}`" :key="`block-${i}-${j}`")
|
|
|
17
|
+ p ids: {{ post.galleries[block.gallery].innerHTML }}
|
|
|
18
|
+ ul.t-cntr(v-if="post.galleries[block.gallery]")
|
|
|
19
|
+ li(v-for="(imageID, j) in getImageIdsForGallery(block.gallery)" :class="`gallery-${i}--image-${j+1}`" :key="`block-${i}-${j}`")
|
|
19
|
20
|
img(@click="openGallery(i - 1, imageID)" :src="post.attached[imageID]['thumbnail']")
|
|
20
|
21
|
//- TO DO Caption stuff and full screen Title/Description
|
|
21
|
22
|
p Caption goes here<br>
|
|
|
@@ -86,6 +87,9 @@ export default {
|
|
86
|
87
|
}, {})
|
|
87
|
88
|
},
|
|
88
|
89
|
|
|
|
90
|
+ idsForGallery() {
|
|
|
91
|
+ return this.post.galleries[this.activeGalleryIndex].attrs.ids
|
|
|
92
|
+ },
|
|
89
|
93
|
/**
|
|
90
|
94
|
* We need a convenient way to get all the images
|
|
91
|
95
|
* broken down by gallery. We use the active gallery
|
|
|
@@ -98,7 +102,7 @@ export default {
|
|
98
|
102
|
// {
|
|
99
|
103
|
// imageId: { 'thumbnail': url, 'large': url }
|
|
100
|
104
|
// }
|
|
101
|
|
- return this.post.galleries[this.activeGalleryIndex].ids.reduce((imageMap, id) => {
|
|
|
105
|
+ return this.idsForGallery.reduce((imageMap, id) => {
|
|
102
|
106
|
imageMap[id] = this.post.attached[id]
|
|
103
|
107
|
return imageMap
|
|
104
|
108
|
}, {})
|
|
|
@@ -108,6 +112,10 @@ export default {
|
|
108
|
112
|
}
|
|
109
|
113
|
},
|
|
110
|
114
|
methods: {
|
|
|
115
|
+ getImageIdsForGallery(galleryIndex) {
|
|
|
116
|
+ console.log(galleryIndex)
|
|
|
117
|
+ return galleryIndex >= 0 ? this.post.galleries[galleryIndex].attrs.ids : []
|
|
|
118
|
+ },
|
|
111
|
119
|
/**
|
|
112
|
120
|
* We set the active gallery to the index.
|
|
113
|
121
|
* Everything kicks off when activeGallery
|