1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Don't show controls before image is fullscreen #587

This commit is contained in:
Patrik J. Braun 2023-09-07 23:51:37 +02:00
parent c8210b975f
commit 01f1b69b41

View File

@ -19,8 +19,9 @@ import {PiTitleService} from '../../../model/pi-title.service';
export enum LightboxStates { export enum LightboxStates {
Open = 1, Open = 1,
Closing = 2, Opening = 2,
Closed = 3, Closing = 3,
Closed = 4,
} }
@Component({ @Component({
@ -220,7 +221,7 @@ export class GalleryLightboxComponent implements OnDestroy, OnInit {
if (this.controls) { if (this.controls) {
this.controls.resetZoom(); this.controls.resetZoom();
} }
this.status = LightboxStates.Open; this.status = LightboxStates.Opening;
const selectedPhoto = this.findPhotoComponent(photo); const selectedPhoto = this.findPhotoComponent(photo);
if (selectedPhoto === null) { if (selectedPhoto === null) {
throw new Error('Can\'t find Photo'); throw new Error('Can\'t find Photo');
@ -234,6 +235,7 @@ export class GalleryLightboxComponent implements OnDestroy, OnInit {
this.calcLightBoxPhotoDimension(selectedPhoto.gridMedia.media) this.calcLightBoxPhotoDimension(selectedPhoto.gridMedia.media)
).onDone((): void => { ).onDone((): void => {
this.animating = false; this.animating = false;
this.status = LightboxStates.Open;
}); });
this.animateLightbox(lightboxDimension, { this.animateLightbox(lightboxDimension, {
top: 0, top: 0,