From e03402433d2524fd3a74bbfce984f843794996ce Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Fri, 5 Jul 2013 02:07:12 +0200 Subject: fix(ngMobile): prevent ngClick when item disabled - the ngClick attribute was always triggered, regardless the ngDisabled/disabled attributes - we now check the DOM disabled status before triggering the original click event Closes #3124 Closes #3132 --- src/ngMobile/directive/ngClick.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ngMobile/directive/ngClick.js b/src/ngMobile/directive/ngClick.js index 3fa68cb4..358a1af9 100644 --- a/src/ngMobile/directive/ngClick.js +++ b/src/ngMobile/directive/ngClick.js @@ -232,10 +232,11 @@ ngMobile.directive('ngClick', ['$parse', '$timeout', '$rootElement', tapElement.blur(); } - scope.$apply(function() { - // TODO(braden): This is sending the touchend, not a tap or click. Is that kosher? - clickHandler(scope, {$event: event}); - }); + if (!angular.isDefined(attr.disabled) || attr.disabled === false) { + scope.$apply(function() { + clickHandler(scope, {$event: event}); + }); + } } resetState(); -- cgit v1.2.3