Fix lightbox multi-loading
This commit is contained in:
@@ -97,7 +97,7 @@ export default {
|
||||
async init() {
|
||||
this.initProject();
|
||||
this.initLightbox();
|
||||
|
||||
|
||||
await Promise.all([
|
||||
this.initFeed(),
|
||||
this.initMap()
|
||||
@@ -107,7 +107,7 @@ export default {
|
||||
if(this.hash.items.length == 3) await this.findPost(this.hash.items[1], this.hash.items[2]);
|
||||
},
|
||||
quit() {
|
||||
this.lightbox?.end();
|
||||
this.lightbox.end();
|
||||
this.$refs.feedSimpleBar.scrollElement.removeEventListener('scroll', this.onFeedScroll);
|
||||
this.setFeedUpdateTimer(-1);
|
||||
this.map.remove();
|
||||
@@ -121,20 +121,22 @@ export default {
|
||||
this.baseMaps = {};
|
||||
},
|
||||
initLightbox() {
|
||||
this.lightbox = new Lightbox({
|
||||
alwaysShowNavOnTouchDevices: true,
|
||||
albumLabel: 'Media %1 / %2',
|
||||
fadeDuration: 300,
|
||||
imageFadeDuration: 400,
|
||||
positionFromTop: 0,
|
||||
resizeDuration: 400,
|
||||
hasVideo: true,
|
||||
onMediaChange: (oMedia) => {
|
||||
this.hash.items = [this.currProject.codename, 'media', oMedia.id];
|
||||
if(oMedia.set == 'post-medias') this.goToPost('media', oMedia.id);
|
||||
},
|
||||
onClosing: () => {this.hash.items = [this.hash.items[0]];}
|
||||
});
|
||||
if(!this.lightbox) {
|
||||
this.lightbox = new Lightbox({
|
||||
alwaysShowNavOnTouchDevices: true,
|
||||
albumLabel: 'Media %1 / %2',
|
||||
fadeDuration: 300,
|
||||
imageFadeDuration: 400,
|
||||
positionFromTop: 0,
|
||||
resizeDuration: 400,
|
||||
hasVideo: true,
|
||||
onMediaChange: (oMedia) => {
|
||||
this.hash.items = [this.currProject.codename, 'media', oMedia.id];
|
||||
if(oMedia.set == 'post-medias') this.goToPost('media', oMedia.id);
|
||||
},
|
||||
onClosing: () => {this.hash.items = [this.hash.items[0]];}
|
||||
});
|
||||
}
|
||||
},
|
||||
async initFeed() {
|
||||
//Simplebar event
|
||||
|
||||
Reference in New Issue
Block a user