Add lightbox to PostComponent

This commit is contained in:
Daniel Supernault 2019-03-09 22:31:29 -07:00
parent 5e40cd1d97
commit e9011c8dfd
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 20 additions and 1 deletions

View File

@ -55,7 +55,7 @@
</div>
<div class="postPresenterContainer d-none d-flex justify-content-center align-items-center">
<div v-if="status.pf_type === 'photo'" class="w-100">
<photo-presenter :status="status"></photo-presenter>
<photo-presenter :status="status" v-on:lightbox="lightbox"></photo-presenter>
</div>
<div v-else-if="status.pf_type === 'video'" class="w-100">
@ -227,6 +227,19 @@
</infinite-loading>
</div>
</b-modal>
<b-modal
id="lightbox"
ref="lightboxModal"
:hide-header="true"
:hide-footer="true"
centered
size="lg"
body-class="p-0"
>
<div v-if="lightboxMedia" :class="lightboxMedia.filter_class">
<img :src="lightboxMedia.url" class="img-fluid">
</div>
</b-modal>
</div>
</template>
@ -249,6 +262,7 @@ export default {
likesPage: 1,
shares: [],
sharesPage: 1,
lightboxMedia: false
}
},
@ -534,6 +548,11 @@ export default {
ownerOrAdmin() {
return this.owner() || this.admin();
},
lightbox(src) {
this.lightboxMedia = src;
this.$refs.lightboxModal.show();
}
},