Skip to content
This repository has been archived by the owner on Dec 23, 2018. It is now read-only.

Commit

Permalink
Bump to version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Dzialocha committed Dec 9, 2016
1 parent 2b5c121 commit 8aa3053
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
angular-swipe
=============

Simple vertical/horizontal swipe gesture directives and a swipe service for angular js >= 1.4. Small extension of the existing angular $swipe service.
Simple vertical/horizontal swipe gesture directives and a swipe service for angular js >= 1.5. Small extension of the existing angular $swipe service.

## Install

+ Add this line to your *bower.json* dependencies and run *bower install* afterwards.

>
``` JavaScript
"angular-swipe": "~0.1.0"
"angular-swipe": "~0.2.0"
```

+ Include the required source file (this path or similar)
Expand Down
8 changes: 4 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "angular-swipe",
"description": "Simple vertical and horizontal swipe gesture directive for angular js",
"version": "0.1.0",
"version": "0.2.0",
"authors": [
"marmorkuchen.net <andreas@marmorkuchen.net>"
],
"homepage": "https://github.com/marmorkuchen-net/angular-swipe",
"homepage": "https://github.com/adzialocha/angular-swipe",
"repository": {
"type": "git",
"url": "git@github.com:marmorkuchen-net/angular-swipe.git"
"url": "git@github.com:adzialocha/angular-swipe.git"
},
"keywords": [
"swipe",
Expand All @@ -23,7 +23,7 @@
],
"main": "./dist/angular-swipe.js",
"dependencies": {
"angular": "~1.4.x"
"angular": "~1.5.x"
},
"ignore": [
".jshintrc",
Expand Down
14 changes: 10 additions & 4 deletions dist/angular-swipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,22 @@
var deltaY = (coords.y - startCoords.y) * direction;
var deltaX = (coords.x - startCoords.x) * direction;

if (! axis){ // horizontal swipe
if(axis === null) { // tap
return Math.abs(deltaY) < MIN_DISTANCE &&
Math.abs(deltaX) < MIN_DISTANCE;
}
else if(axis === false) { // horizontal swipe
return Math.abs(deltaY) < MAX_OTHER_AXIS_DISTANCE &&
deltaX > 0 &&
deltaX > MIN_DISTANCE &&
Math.abs(deltaY) / deltaX < MAX_RATIO;
} else { // vertical swipe
}
else { // vertical swipe
return Math.abs(deltaX) < MAX_OTHER_AXIS_DISTANCE &&
deltaY > 0 &&
deltaY > MIN_DISTANCE &&
Math.abs(deltaX) / deltaY < MAX_RATIO;
}

}

var pointerTypes = ['touch'];
Expand Down Expand Up @@ -227,4 +231,6 @@
makeSwipeDirective('ngSwipeUp', -1, true, 'swipeup');
makeSwipeDirective('ngSwipeDown', 1, true, 'swipedown');

})(window, window.angular);
makeSwipeDirective('ngTap', 1, null, 'tap');

})(window, window.angular);
4 changes: 2 additions & 2 deletions dist/angular-swipe.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "angular-swipe",
"version": "0.1.0",
"version": "0.2.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-copy": "~0.8.0",
"grunt-contrib-concat": "~0.5.1",
"grunt-contrib-uglify": "~0.9.1",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-connect": "~0.10.1",
"grunt-contrib-clean": "~0.6.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-mocha": "~0.4.13",
"load-grunt-tasks": "~3.2.0"
"grunt": "^1.0.1",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-uglify": "^2.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-mocha": "^1.0.2",
"load-grunt-tasks": "^3.5.2"
},
"engines": {
"node": ">=0.8.0"
Expand Down

0 comments on commit 8aa3053

Please sign in to comment.