From bad58824a0c46972d08c14bf9407cb7f31c40ddd Mon Sep 17 00:00:00 2001 From: Joao Dias Date: Sun, 30 Oct 2016 22:25:42 +0100 Subject: [PATCH] refactor(playground): update gestures playground to use latest hammer.js --- build.sh | 1 + modules/playground/src/gestures/index.html | 13 +------------ modules/playground/src/gestures/index.ts | 8 +++----- npm-shrinkwrap.clean.json | 6 +++++- npm-shrinkwrap.json | 10 ++++++++-- package.json | 3 ++- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/build.sh b/build.sh index 17c7c63b11..e837a8e715 100755 --- a/build.sh +++ b/build.sh @@ -67,6 +67,7 @@ if [[ ${BUILD_ALL} == true ]]; then ln -s ../../../../node_modules/reflect-metadata/Reflect.js . ln -s ../../../../node_modules/rxjs . ln -s ../../../../node_modules/angular/angular.js . + ln -s ../../../../node_modules/hammerjs/hammer.js . cd - echo "====== Copying files needed for benchmarks =====" diff --git a/modules/playground/src/gestures/index.html b/modules/playground/src/gestures/index.html index 72232d30f9..746684c1e9 100644 --- a/modules/playground/src/gestures/index.html +++ b/modules/playground/src/gestures/index.html @@ -15,18 +15,7 @@ - - + diff --git a/modules/playground/src/gestures/index.ts b/modules/playground/src/gestures/index.ts index ef46377849..29d099f5e7 100644 --- a/modules/playground/src/gestures/index.ts +++ b/modules/playground/src/gestures/index.ts @@ -16,13 +16,11 @@ class GesturesCmp { pinchScale: number = 1; rotateAngle: number = 0; - onSwipe(event: any /** TODO #9100 */): void { - this.swipeDirection = event.deltaX > 0 ? 'right' : 'left'; - } + onSwipe(event: HammerInput): void { this.swipeDirection = event.deltaX > 0 ? 'right' : 'left'; } - onPinch(event: any /** TODO #9100 */): void { this.pinchScale = event.scale; } + onPinch(event: HammerInput): void { this.pinchScale = event.scale; } - onRotate(event: any /** TODO #9100 */): void { this.rotateAngle = event.rotation; } + onRotate(event: HammerInput): void { this.rotateAngle = event.rotation; } } @NgModule({declarations: [GesturesCmp], bootstrap: [GesturesCmp], imports: [BrowserModule]}) diff --git a/npm-shrinkwrap.clean.json b/npm-shrinkwrap.clean.json index 6a8e9ebb16..124af847b5 100644 --- a/npm-shrinkwrap.clean.json +++ b/npm-shrinkwrap.clean.json @@ -11,7 +11,7 @@ "dev": true }, "@types/hammerjs": { - "version": "2.0.22-alpha", + "version": "2.0.33", "dev": true }, "@types/jasmine": { @@ -3490,6 +3490,10 @@ "version": "1.0.0", "dev": true }, + "hammerjs": { + "version": "2.0.8", + "dev": true + }, "handlebars": { "version": "4.0.5", "dev": true, diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4483264c96..f5df11882c 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -15,9 +15,9 @@ "dev": true }, "@types/hammerjs": { - "version": "2.0.22-alpha", + "version": "2.0.33", "from": "@types/hammerjs@latest", - "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.22-alpha.tgz", + "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.33.tgz", "dev": true }, "@types/jasmine": { @@ -5066,6 +5066,12 @@ "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", "dev": true }, + "hammerjs": { + "version": "2.0.8", + "from": "hammerjs@latest", + "resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz", + "dev": true + }, "handlebars": { "version": "4.0.5", "from": "handlebars@>=4.0.2 <5.0.0", diff --git a/package.json b/package.json index afc6551843..edf9f49bf7 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "devDependencies": { "@types/angularjs": "^1.5.13-alpha", "@types/fs-extra": "0.0.22-alpha", - "@types/hammerjs": "^2.0.22-alpha", + "@types/hammerjs": "^2.0.33", "@types/jasmine": "^2.2.22-alpha", "@types/node": "^4.0.22-alpha", "@types/protractor": "^1.5.11-alpha", @@ -51,6 +51,7 @@ "gulp-connect": "^2.3.1", "gulp-conventional-changelog": "^1.1.0", "gulp-tslint": "^6.1.1", + "hammerjs": "^2.0.8", "incremental-dom": "^0.4.1", "jasmine": "^2.4.1", "jasmine-core": "^2.3.4",