From a845ff348943beba2fd4758744f7ee7b865b4ade Mon Sep 17 00:00:00 2001 From: Andy Joslin Date: Fri, 25 Apr 2014 06:33:59 -0600 Subject: [PATCH] fix(ionList): do not let option button click propagate to item Addresses #1202 --- js/angular/directive/itemOptionButton.js | 2 ++ js/angular/directive/ngClick.js | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/js/angular/directive/itemOptionButton.js b/js/angular/directive/itemOptionButton.js index 758ed19b9da..1a7caa7b4ca 100644 --- a/js/angular/directive/itemOptionButton.js +++ b/js/angular/directive/itemOptionButton.js @@ -41,6 +41,8 @@ return { itemCtrl.$element.append(itemCtrl.optionsContainer); } itemCtrl.optionsContainer.append($element); + + $element.on('click', eventStopPropagation); }; } }; diff --git a/js/angular/directive/ngClick.js b/js/angular/directive/ngClick.js index 756134ac856..c29ede86095 100644 --- a/js/angular/directive/ngClick.js +++ b/js/angular/directive/ngClick.js @@ -34,13 +34,13 @@ IonicModule }]) .directive('ionStopEvent', function () { - function stopEvent(e) { - e.stopPropagation(); - } return { restrict: 'A', link: function (scope, element, attr) { - element.bind(attr.ionStopEvent, stopEvent); + element.bind(attr.ionStopEvent, eventStopPropagation); } }; }); +function eventStopPropagation(e) { + e.stopPropagation(); +}