aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngTouch/directive/ngClick.js
diff options
context:
space:
mode:
authorSteven Sojka2013-09-04 11:20:33 -0500
committerJeff Cross2013-10-08 09:14:33 -0700
commit9fd92cc3c93a6378e8887fd46fd4ad182a375544 (patch)
tree0196a2c9eabc6e94400d7a17a61f372048350df4 /src/ngTouch/directive/ngClick.js
parentf7fc00841bf5e3ffa2d9c2b1d316ed4dcdcde756 (diff)
downloadangular.js-9fd92cc3c93a6378e8887fd46fd4ad182a375544.tar.bz2
fix(ngTouch): ngClick does not pass touchend event when jQuery is loaded
The trigger handler event in jqLite takes an event object as a second parameter, but jQuery requires an array of parameters. This is causing the touchend event to not come thtough in the click handler when jQuery is loaded.
Diffstat (limited to 'src/ngTouch/directive/ngClick.js')
-rw-r--r--src/ngTouch/directive/ngClick.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ngTouch/directive/ngClick.js b/src/ngTouch/directive/ngClick.js
index d6e404ca..7dcc4041 100644
--- a/src/ngTouch/directive/ngClick.js
+++ b/src/ngTouch/directive/ngClick.js
@@ -238,7 +238,7 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
}
if (!angular.isDefined(attr.disabled) || attr.disabled === false) {
- element.triggerHandler('click', event);
+ element.triggerHandler('click', [event]);
}
}
@@ -255,9 +255,9 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
// - On mobile browsers, the simulated "fast" click will call this.
// - But the browser's follow-up slow click will be "busted" before it reaches this handler.
// Therefore it's safe to use this directive on both mobile and desktop.
- element.on('click', function(event) {
+ element.on('click', function(event, touchend) {
scope.$apply(function() {
- clickHandler(scope, {$event: event});
+ clickHandler(scope, {$event: (touchend || event)});
});
});