Skip to content

Commit

Permalink
Fix error if initially disabled #73
Browse files Browse the repository at this point in the history
  • Loading branch information
drozhzhin-n-e committed Oct 27, 2020
1 parent 8adb728 commit 599615a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/pinch-zoom/pinch-zoom.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export class PinchZoomComponent implements OnDestroy {
}

get isDragging() {
return this.pinchZoom.isDragging();
if (this.pinchZoom) {
return this.pinchZoom.isDragging();
}
}

get isDisabled() {
Expand All @@ -93,9 +95,6 @@ export class PinchZoomComponent implements OnDestroy {

ngOnInit(){
this.initPinchZoom();

/* Calls the method until the image size is available */
this.pollLimitZoom();
}

ngOnChanges(changes) {
Expand All @@ -116,6 +115,9 @@ export class PinchZoomComponent implements OnDestroy {

this.properties['element'] = this.elementRef.nativeElement.querySelector('.pinch-zoom-content');
this.pinchZoom = new IvyPinch(this.properties);

/* Calls the method until the image size is available */
this.pollLimitZoom();
}

getProperties(changes){
Expand Down

0 comments on commit 599615a

Please sign in to comment.