From de3cf534a0987b6d2a1959d0c5e74faae132c6a1 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 26 Nov 2019 02:30:03 +0300 Subject: [PATCH] fix(thumbnails): Fix SafeStyles --- .../ngx-gallery-thumbnails.component.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.ts b/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.ts index 385fa823..a0048897 100644 --- a/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.ts +++ b/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.ts @@ -168,7 +168,7 @@ export class NgxGalleryThumbnailsComponent implements OnInit, OnChanges { return this.index !== 0; } - getThumbnailLeft(index: number): string { + getThumbnailLeft(index: number): SafeStyle { let calculatedIndex; if (this.order === NgxGalleryOrder.Column) { @@ -184,7 +184,7 @@ export class NgxGalleryThumbnailsComponent implements OnInit, OnChanges { return this.getThumbnailPosition(calculatedIndex, this.columns); } - getThumbnailTop(index: number): string { + getThumbnailTop(index: number): SafeStyle { let calculatedIndex; if (this.order === NgxGalleryOrder.Column) { @@ -256,9 +256,9 @@ export class NgxGalleryThumbnailsComponent implements OnInit, OnChanges { return this.sanitization.bypassSecurityTrustStyle(this.helperService.getBackgroundUrl(image)); } - private getThumbnailPosition(index: number, count: number): string { - return 'calc(' + ((100 / count) * index) + '% + ' - + ((this.margin - (((count - 1) * this.margin) / count)) * index) + 'px)'; + private getThumbnailPosition(index: number, count: number): SafeStyle { + return this.getSafeStyle('calc(' + ((100 / count) * index) + '% + ' + + ((this.margin - (((count - 1) * this.margin) / count)) * index) + 'px)'); } private getThumbnailDimension(count: number): string {