mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
Fix map open and hide animation #587
This commit is contained in:
parent
44978f8b53
commit
b090bd5b24
@ -199,7 +199,7 @@ export class GalleryMapLightboxComponent implements OnChanges {
|
|||||||
this.visible = true;
|
this.visible = true;
|
||||||
this.opacity = 1.0;
|
this.opacity = 1.0;
|
||||||
this.startPosition = position;
|
this.startPosition = position;
|
||||||
this.lightboxDimension = position;
|
this.lightboxDimension = Utils.clone(position);
|
||||||
this.lightboxDimension.top -= PageHelper.ScrollY;
|
this.lightboxDimension.top -= PageHelper.ScrollY;
|
||||||
this.mapDimension = {
|
this.mapDimension = {
|
||||||
top: 0,
|
top: 0,
|
||||||
@ -228,7 +228,7 @@ export class GalleryMapLightboxComponent implements OnChanges {
|
|||||||
this.controllersVisible = false;
|
this.controllersVisible = false;
|
||||||
const to = this.startPosition;
|
const to = this.startPosition;
|
||||||
|
|
||||||
// iff target image out of screen -> scroll to there
|
// if target image out of screen -> scroll to there
|
||||||
if (
|
if (
|
||||||
PageHelper.ScrollY > to.top ||
|
PageHelper.ScrollY > to.top ||
|
||||||
PageHelper.ScrollY + GalleryMapLightboxComponent.getScreenHeight() <
|
PageHelper.ScrollY + GalleryMapLightboxComponent.getScreenHeight() <
|
||||||
|
@ -24,4 +24,6 @@
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
position: absolute;
|
||||||
|
transform: translateY(-100%);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<app-gallery-map-lightbox [photos]="photos" [gpxFiles]="gpxFiles"></app-gallery-map-lightbox>
|
<app-gallery-map-lightbox [photos]="photos" [gpxFiles]="gpxFiles"></app-gallery-map-lightbox>
|
||||||
<div class="clickable" id="map" #map (click)="click()">
|
<div class="clickable" id="map" #map>
|
||||||
<div
|
<div
|
||||||
class="leaflet-map"
|
class="leaflet-map"
|
||||||
leaflet
|
leaflet
|
||||||
@ -7,5 +7,6 @@
|
|||||||
[leafletLayers]="markerLayer"
|
[leafletLayers]="markerLayer"
|
||||||
(leafletMapReady)="onMapReady($event)">
|
(leafletMapReady)="onMapReady($event)">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="overlay" (click)="click()">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -129,8 +129,8 @@ export class GalleryMapComponent implements OnChanges, IRenderable {
|
|||||||
|
|
||||||
public getDimension(): Dimension {
|
public getDimension(): Dimension {
|
||||||
return {
|
return {
|
||||||
top: this.mapElement.nativeElement.offsetTop,
|
top: this.mapElement.nativeElement.parentElement.offsetParent.offsetTop,
|
||||||
left: this.mapElement.nativeElement.offsetLeft,
|
left: this.mapElement.nativeElement.parentElement.offsetLeft,
|
||||||
width: this.mapElement.nativeElement.offsetWidth,
|
width: this.mapElement.nativeElement.offsetWidth,
|
||||||
height: this.mapElement.nativeElement.offsetHeight,
|
height: this.mapElement.nativeElement.offsetHeight,
|
||||||
} as Dimension;
|
} as Dimension;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user