aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngTouch/directive/ngSwipe.js
diff options
context:
space:
mode:
authorAdam Kent2013-10-08 14:49:56 +1100
committerPete Bacon Darwin2013-10-08 12:55:16 +0100
commit507d8021b1c91cc0cefc0418e61b04597ad1030b (patch)
treefb58a88337d65c7d28f3883bcf5f86fd77aa1dfb /src/ngTouch/directive/ngSwipe.js
parentbed08c9c6661d6da5ed6337f194402ea02a8d14c (diff)
downloadangular.js-507d8021b1c91cc0cefc0418e61b04597ad1030b.tar.bz2
fix(ngTouch): add $event to ng-swipe
Existing documentation implies that an Event object should be available as `$event` on swipe directives, which previously was only working for `ng-click`. Closes #4071 Closes #4321
Diffstat (limited to 'src/ngTouch/directive/ngSwipe.js')
-rw-r--r--src/ngTouch/directive/ngSwipe.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ngTouch/directive/ngSwipe.js b/src/ngTouch/directive/ngSwipe.js
index a5911f9a..7a468374 100644
--- a/src/ngTouch/directive/ngSwipe.js
+++ b/src/ngTouch/directive/ngSwipe.js
@@ -92,18 +92,18 @@ function makeSwipeDirective(directiveName, direction, eventName) {
}
$swipe.bind(element, {
- 'start': function(coords) {
+ 'start': function(coords, event) {
startCoords = coords;
valid = true;
},
- 'cancel': function() {
+ 'cancel': function(event) {
valid = false;
},
- 'end': function(coords) {
+ 'end': function(coords, event) {
if (validSwipe(coords)) {
scope.$apply(function() {
element.triggerHandler(eventName);
- swipeHandler(scope);
+ swipeHandler(scope, {$event: event});
});
}
}