diff --git a/.gitignore b/.gitignore index ad9901b..167a18b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ Thumbs.db *.map *.d.ts *.css +*.tgz # Ignored folders dist diff --git a/.npmignore b/.npmignore index ef123df..6f09673 100644 --- a/.npmignore +++ b/.npmignore @@ -6,9 +6,11 @@ yarn.lock # OS generated files Thumbs.db .DS_Store +.vscode # Ignored files & folders *.ts !*.d.ts /src -/demo \ No newline at end of file +demo +config diff --git a/ionic-img-viewer-1.1.4.tgz b/ionic-img-viewer-1.1.4.tgz deleted file mode 100644 index 712d5f2..0000000 Binary files a/ionic-img-viewer-1.1.4.tgz and /dev/null differ diff --git a/package.json b/package.json index 3c0e7ad..65ab12d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ionic-img-viewer", - "version": "1.1.7", + "version": "1.1.8", "description": "Ionic 2 component providing a Twitter inspired experience to visualize pictures.", "main": "./dist/ionic-img-viewer.js", "typings": "./dist/ionic-img-viewer.d.ts", @@ -21,22 +21,22 @@ "author": "Orion Charlier", "license": "MIT", "dependencies": { - "@angular/common": "2.1.1", - "@angular/compiler": "2.1.1", - "@angular/compiler-cli": "2.1.1", - "@angular/core": "2.1.1", - "@angular/forms": "2.1.1", - "@angular/http": "2.1.1", - "@angular/platform-browser": "2.1.1", - "@angular/platform-browser-dynamic": "2.1.1", - "@angular/platform-server": "2.1.1", + "@angular/common": "2.2.1", + "@angular/compiler": "2.2.1", + "@angular/compiler-cli": "2.2.1", + "@angular/core": "2.2.1", + "@angular/forms": "2.2.1", + "@angular/http": "2.2.1", + "@angular/platform-browser": "2.2.1", + "@angular/platform-browser-dynamic": "2.2.1", + "@angular/platform-server": "2.2.1", "@ionic/storage": "1.1.6", - "ionic-angular": "2.0.0-rc.3", + "ionic-angular": "2.0.0-rc.4", "rxjs": "5.0.0-beta.12", "zone.js": "0.6.26" }, "devDependencies": { - "typescript": "2.0.6", + "typescript": "2.0.9", "copyfiles": "1.0.0" } } diff --git a/src/image-viewer-gesture.ts b/src/image-viewer-gesture.ts index e6f22a1..2c425d0 100644 --- a/src/image-viewer-gesture.ts +++ b/src/image-viewer-gesture.ts @@ -1,7 +1,7 @@ import { ImageViewerComponent } from './image-viewer.component'; import { PanGesture } from 'ionic-angular/gestures/drag-gesture'; import { CSS, nativeRaf, pointerCoord } from 'ionic-angular/util/dom'; -import { Animation } from 'ionic-angular'; +import { Animation, DomController } from 'ionic-angular'; const HAMMER_THRESHOLD = 10; const MAX_ATTACK_ANGLE = 45; @@ -15,12 +15,13 @@ export class ImageViewerGesture extends PanGesture { private imageContainer: HTMLElement; private backdrop: HTMLElement; - constructor(private component: ImageViewerComponent, private cb: Function) { + constructor(private component: ImageViewerComponent, domCtrl: DomController, private cb: Function) { super(component.getNativeElement(), { maxAngle: MAX_ATTACK_ANGLE, threshold: HAMMER_THRESHOLD, gesture: component._gestureCtrl.createGesture({ name: 'image-viewer' }), - direction: 'y' + direction: 'y', + domController: domCtrl }); this.translationY = 0; diff --git a/src/image-viewer.component.ts b/src/image-viewer.component.ts index c0bb301..d355f91 100644 --- a/src/image-viewer.component.ts +++ b/src/image-viewer.component.ts @@ -1,4 +1,4 @@ -import { NavController, NavParams, Transition } from 'ionic-angular'; +import { DomController, NavController, NavParams, Transition } from 'ionic-angular'; import { Ion } from 'ionic-angular/components/ion'; import { PanGesture } from 'ionic-angular/gestures/drag-gesture'; import { GestureController } from 'ionic-angular/gestures/gesture-controller'; @@ -41,6 +41,7 @@ export class ImageViewerComponent extends Ion implements OnInit, OnDestroy { private _nav: NavController, private _zone: NgZone, private renderer: Renderer, + private domCtrl: DomController, _navParams: NavParams, _config: Config, _sanitizer: DomSanitizer @@ -53,7 +54,7 @@ export class ImageViewerComponent extends Ion implements OnInit, OnDestroy { ngOnInit() { let gestureCallBack = () => this._nav.pop(); - this._zone.runOutsideAngular(() => this.dragGesture = new ImageViewerGesture(this, gestureCallBack)); + this._zone.runOutsideAngular(() => this.dragGesture = new ImageViewerGesture(this, this.domCtrl, gestureCallBack)); } ngOnDestroy() {