This commit is contained in:
@@ -69,6 +69,9 @@ export default {
|
||||
isMarkerVisible: (oLngLat) => this.$refs.mapCtrl.isMarkerVisible(oLngLat),
|
||||
findMarkerByMediaId: (iMediaId) => this.$refs.mapCtrl.findMarkerByMediaId(iMediaId)
|
||||
},
|
||||
lightbox: {
|
||||
open: (iMediaId, sSource) => this.openLightbox(iMediaId, sSource)
|
||||
},
|
||||
project: this
|
||||
};
|
||||
},
|
||||
@@ -119,13 +122,19 @@ export default {
|
||||
const pMapReady = this.initProjectMap();
|
||||
await this.feed.init(pMapReady);
|
||||
},
|
||||
openLightbox(iMediaId, sSource) {
|
||||
const aoAlbum = (sSource == 'marker')
|
||||
? (this.$refs.mapCtrl.findMarkerByMediaId(iMediaId)?.medias || [])
|
||||
: this.feed.posts.filter((oPost) => oPost.type == 'media');
|
||||
this.$refs.lightbox.open(aoAlbum, iMediaId, sSource);
|
||||
},
|
||||
async onLightboxMediaChange(oMedia) {
|
||||
this.hash.items = [this.project.codename, 'media', oMedia.id];
|
||||
if(oMedia.set == 'post-medias') {
|
||||
if(oMedia.source == 'post') {
|
||||
(await this.feed.findPost('media', oMedia.id))?.panMapToMarker();
|
||||
if(!this.$refs.lightbox.hasMediaAfterCurrent()) {
|
||||
await this.feed.getNextFeed();
|
||||
this.$refs.lightbox.refreshAlbum();
|
||||
this.$refs.lightbox.refreshAlbum(this.feed.posts.filter((oPost) => oPost.type == 'media'));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user