From fe199a85e18b314de23c53b10e935a2f55c267cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gary=20Gro=C3=9Fgarten?= Date: Wed, 10 Jul 2019 01:05:31 +0200 Subject: [PATCH] feat(gallery): ambient backdrop color input --- .../lib/gallery/gallery-image/gallery-image.component.ts | 6 +++--- projects/core/src/lib/gallery/gallery.component.html | 6 ++++-- projects/core/src/lib/gallery/gallery.component.ts | 3 +++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/projects/core/src/lib/gallery/gallery-image/gallery-image.component.ts b/projects/core/src/lib/gallery/gallery-image/gallery-image.component.ts index 5d3424ac..7787a888 100644 --- a/projects/core/src/lib/gallery/gallery-image/gallery-image.component.ts +++ b/projects/core/src/lib/gallery/gallery-image/gallery-image.component.ts @@ -144,9 +144,9 @@ export class FivGalleryImage implements OnInit { this.animationParams = this.getThumbnailPosition(this.image); this.overlay.show(49999); - this.backdropColor = this.imageService.getAverageRGB( - this.image.nativeElement - ); + this.backdropColor = this.gallery.ambient + ? this.imageService.getAverageRGB(this.image.nativeElement) + : '#000'; } close(position: Position) { diff --git a/projects/core/src/lib/gallery/gallery.component.html b/projects/core/src/lib/gallery/gallery.component.html index 11944ed3..471d4231 100644 --- a/projects/core/src/lib/gallery/gallery.component.html +++ b/projects/core/src/lib/gallery/gallery.component.html @@ -7,7 +7,8 @@ - + @@ -15,7 +16,8 @@
+ (fivRefresh)="closeFromPullDown($event)" [enabled]="pullEnabled" (fivCancel)="resetPan($event)" + [enableScroll]="true"> diff --git a/projects/core/src/lib/gallery/gallery.component.ts b/projects/core/src/lib/gallery/gallery.component.ts index 8b16cca7..3c09426a 100644 --- a/projects/core/src/lib/gallery/gallery.component.ts +++ b/projects/core/src/lib/gallery/gallery.component.ts @@ -94,7 +94,9 @@ export class FivGallery implements OnInit, AfterContentInit { zoomedIn: boolean; controlsVisible = true; @Input() pagerVisible = true; + @Input() ambient = true; private slidesLoaded; + pullEnabled = false; @HostListener('window:keyup', ['$event']) keyEvent(event: KeyboardEvent) { @@ -179,6 +181,7 @@ export class FivGallery implements OnInit, AfterContentInit { this.overlay.show(50000); this.initialImage = initial; this.showControls(); + this.pullEnabled = true } close() {