Skip to content

Commit

Permalink
refactor(gallery): Remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kolkov committed Feb 11, 2020
1 parent be96d90 commit 2556395
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {AfterViewInit, ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output} from '@angular/core';

@Component({
selector: 'ngx-gallery-action',
Expand All @@ -13,7 +13,8 @@ export class NgxGalleryActionComponent implements OnInit/*, AfterViewInit*/ {

@Output() closeClick: EventEmitter<Event> = new EventEmitter();

constructor() { }
constructor() {
}

ngOnInit() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Component,
ElementRef,
EventEmitter,
HostBinding,
HostListener,
Input,
OnChanges,
Expand Down Expand Up @@ -52,7 +51,8 @@ export class NgxGalleryImageComponent implements OnInit, OnChanges {
private timer;

constructor(private sanitization: DomSanitizer,
private elementRef: ElementRef, private helperService: NgxGalleryService) { }
private elementRef: ElementRef, private helperService: NgxGalleryService) {
}

// @HostBinding('style.display') public display = 'inline-block';
// @HostBinding('style.background-color') public color = 'lime';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import {
ElementRef,
EventEmitter,
HostListener,
Input, OnChanges, OnDestroy,
Input,
OnChanges,
OnDestroy,
OnInit,
Output, Renderer2,
Output,
Renderer2,
SimpleChanges,
ViewChild, ViewEncapsulation
ViewChild
} from '@angular/core';
import {DomSanitizer, SafeResourceUrl, SafeStyle, SafeUrl} from '@angular/platform-browser';
import {NgxGalleryService} from '../ngx-gallery.service';
Expand Down Expand Up @@ -88,7 +91,8 @@ export class NgxGalleryPreviewComponent implements OnInit, OnDestroy, OnChanges

constructor(private sanitization: DomSanitizer, private elementRef: ElementRef,
private helperService: NgxGalleryService, private renderer: Renderer2,
private changeDetectorRef: ChangeDetectorRef) { }
private changeDetectorRef: ChangeDetectorRef) {
}

ngOnInit() {
if (this.arrows && this.arrowsAutoHide) {
Expand Down Expand Up @@ -398,7 +402,6 @@ export class NgxGalleryPreviewComponent implements OnInit, OnDestroy, OnChanges
}



private show(first = false) {
this.loading = true;
this.stopAutoPlay();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export class NgxGalleryThumbnailsComponent implements OnInit, OnChanges {
private index = 0;

constructor(private sanitization: DomSanitizer, private elementRef: ElementRef,
private helperService: NgxGalleryService) { }
private helperService: NgxGalleryService) {
}

ngOnInit() {
}
Expand Down Expand Up @@ -209,9 +210,9 @@ export class NgxGalleryThumbnailsComponent implements OnInit, OnChanges {
}

setThumbnailsPosition(): void {
this.thumbnailsLeft = - ((100 / this.columns) * this.index) + '%';
this.thumbnailsLeft = -((100 / this.columns) * this.index) + '%';

this.thumbnailsMarginLeft = - ((this.margin - (((this.columns - 1)
this.thumbnailsMarginLeft = -((this.margin - (((this.columns - 1)
* this.margin) / this.columns)) * this.index) + 'px';
}

Expand Down
15 changes: 10 additions & 5 deletions projects/gallery/src/lib/ngx-gallery.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import {
AfterViewInit, ChangeDetectionStrategy,
AfterViewInit,
ChangeDetectionStrategy,
Component,
DoCheck,
ElementRef, EventEmitter,
ElementRef,
EventEmitter,
HostBinding,
HostListener, Input,
OnInit, Output,
HostListener,
Input,
OnInit,
Output,
ViewChild,
ViewEncapsulation
} from '@angular/core';
Expand Down Expand Up @@ -65,7 +69,8 @@ export class NgxGalleryComponent implements OnInit, DoCheck, AfterViewInit {
@HostBinding('style.height') height: string;
@HostBinding('style.left') left: string;

constructor(private myElement: ElementRef) {}
constructor(private myElement: ElementRef) {
}

ngOnInit() {
this.options = this.options.map((opt) => new NgxGalleryOptions(opt));
Expand Down
6 changes: 4 additions & 2 deletions projects/gallery/src/lib/ngx-gallery.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {ElementRef, Injectable, Renderer2} from '@angular/core';
export class NgxGalleryService {
private swipeHandlers: Map<string, (() => void)[]> = new Map<string, (() => void)[]>();

constructor(private renderer: Renderer2) {}
constructor(private renderer: Renderer2) {
}

manageSwipe(status: boolean, element: ElementRef, id: string, nextHandler: () => void, prevHandler: () => void): void {

Expand All @@ -23,7 +24,8 @@ export class NgxGalleryService {
handlers.map((handler) => handler());
this.removeSwipeHandlers(id);
}
} catch (e) {}
} catch (e) {
}
}

validateUrl(url: string): string {
Expand Down

0 comments on commit 2556395

Please sign in to comment.