From 8aa3053b4f6858b8ced1e27ac7453acb503a45d3 Mon Sep 17 00:00:00 2001 From: Andreas Dzialocha Date: Fri, 9 Dec 2016 18:40:02 +0100 Subject: [PATCH] Bump to version 0.2.0 --- README.md | 4 ++-- bower.json | 8 ++++---- dist/angular-swipe.js | 14 ++++++++++---- dist/angular-swipe.min.js | 4 ++-- package.json | 22 +++++++++++----------- 5 files changed, 29 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3f071aa..ffe34e6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ 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 @@ -9,7 +9,7 @@ Simple vertical/horizontal swipe gesture directives and a swipe service for angu > ``` JavaScript -"angular-swipe": "~0.1.0" +"angular-swipe": "~0.2.0" ``` + Include the required source file (this path or similar) diff --git a/bower.json b/bower.json index fb2e17d..1578f62 100644 --- a/bower.json +++ b/bower.json @@ -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 " ], - "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", @@ -23,7 +23,7 @@ ], "main": "./dist/angular-swipe.js", "dependencies": { - "angular": "~1.4.x" + "angular": "~1.5.x" }, "ignore": [ ".jshintrc", diff --git a/dist/angular-swipe.js b/dist/angular-swipe.js index eefc1e5..9e0d34e 100644 --- a/dist/angular-swipe.js +++ b/dist/angular-swipe.js @@ -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']; @@ -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); \ No newline at end of file diff --git a/dist/angular-swipe.min.js b/dist/angular-swipe.min.js index c507bb1..150cf7d 100644 --- a/dist/angular-swipe.min.js +++ b/dist/angular-swipe.min.js @@ -1,2 +1,2 @@ -/*! angular-swipe.min.js 20-04-2016 */ -!function(a,b,c){"use strict";function d(a,c,d,f){e.directive(a,["$parse","swipe",function(e,g){var h=75,i=.3,j=30;return function(k,l,m){function n(a,b){do{var c=a.getAttribute("class");if(c&&null!==c.match(b))return!0;a=a.parentElement}while(null!==a);return!1}function o(a){if(!p||!q)return!1;var b=(a.y-p.y)*c,e=(a.x-p.x)*c;return d?Math.abs(e)0&&b>j&&Math.abs(e)/b0&&e>j&&Math.abs(b)/eh&&d>i)){if(!m){var g,o,p;g=Math.abs(c.x-j.x),o=Math.abs(c.y-j.y),p=o/g,e>p?(b.preventDefault(),n=!1):n=!0,m=!0}b.isVertical=n,f.move&&f.move(c,b)}}}),b.on(c(g,"end"),function(b){l&&(b.isVertical=n,l=!1,f.end&&f.end(a(b),b))})}}}]);try{b.module("ngTouch")}catch(f){d("ngSwipeLeft",-1,!1,"swipeleft"),d("ngSwipeRight",1,!1,"swiperight")}d("ngSwipeUp",-1,!0,"swipeup"),d("ngSwipeDown",1,!0,"swipedown")}(window,window.angular); \ No newline at end of file +/*! angular-swipe.min.js 09-12-2016 */ +!function(a,b,c){"use strict";function d(a,c,d,f){e.directive(a,["$parse","swipe",function(e,g){var h=75,i=.3,j=30;return function(k,l,m){function n(a,b){do{var c=a.getAttribute("class");if(c&&null!==c.match(b))return!0;a=a.parentElement}while(null!==a);return!1}function o(a){if(!p||!q)return!1;var b=(a.y-p.y)*c,e=(a.x-p.x)*c;return null===d?Math.abs(b)0&&e>j&&Math.abs(b)/e0&&b>j&&Math.abs(e)/b=0.8.0"