mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-02-07 04:10:46 +00:00
Add lightbox to PostComponent
This commit is contained in:
parent
5e40cd1d97
commit
e9011c8dfd
1 changed files with 20 additions and 1 deletions
|
@ -55,7 +55,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="postPresenterContainer d-none d-flex justify-content-center align-items-center">
|
<div class="postPresenterContainer d-none d-flex justify-content-center align-items-center">
|
||||||
<div v-if="status.pf_type === 'photo'" class="w-100">
|
<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>
|
||||||
|
|
||||||
<div v-else-if="status.pf_type === 'video'" class="w-100">
|
<div v-else-if="status.pf_type === 'video'" class="w-100">
|
||||||
|
@ -227,6 +227,19 @@
|
||||||
</infinite-loading>
|
</infinite-loading>
|
||||||
</div>
|
</div>
|
||||||
</b-modal>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -249,6 +262,7 @@ export default {
|
||||||
likesPage: 1,
|
likesPage: 1,
|
||||||
shares: [],
|
shares: [],
|
||||||
sharesPage: 1,
|
sharesPage: 1,
|
||||||
|
lightboxMedia: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -534,6 +548,11 @@ export default {
|
||||||
|
|
||||||
ownerOrAdmin() {
|
ownerOrAdmin() {
|
||||||
return this.owner() || this.admin();
|
return this.owner() || this.admin();
|
||||||
|
},
|
||||||
|
|
||||||
|
lightbox(src) {
|
||||||
|
this.lightboxMedia = src;
|
||||||
|
this.$refs.lightboxModal.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue