Skip to content

Commit

Permalink
fix(thumbnails): Fix SafeStyles
Browse files Browse the repository at this point in the history
  • Loading branch information
kolkov committed Nov 25, 2019
1 parent c54ca3b commit de3cf53
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit de3cf53

Please sign in to comment.