diff --git a/js/angular/directive/itemOptionButton.js b/js/angular/directive/itemOptionButton.js index 2a80731ac1..d88e306b05 100644 --- a/js/angular/directive/itemOptionButton.js +++ b/js/angular/directive/itemOptionButton.js @@ -29,21 +29,25 @@ var ITEM_TPL_OPTION_BUTTONS = */ IonicModule .directive('ionOptionButton', ['$compile', function($compile) { -return { - restrict: 'E', - require: '^ionItem', - priority: Number.MAX_VALUE, - compile: function($element, $attr) { - $attr.$set('class', ($attr['class'] || '') + ' button', true); - return function($scope, $element, $attr, itemCtrl) { - if (!itemCtrl.optionsContainer) { - itemCtrl.optionsContainer = jqLite(ITEM_TPL_OPTION_BUTTONS); - itemCtrl.$element.append(itemCtrl.optionsContainer); - } - itemCtrl.optionsContainer.append($element); - - $element.on('click', eventStopPropagation); - }; + function stopPropagation(e) { + e.stopPropagation(); } -}; + return { + restrict: 'E', + require: '^ionItem', + priority: Number.MAX_VALUE, + compile: function($element, $attr) { + $attr.$set('class', ($attr['class'] || '') + ' button', true); + return function($scope, $element, $attr, itemCtrl) { + if (!itemCtrl.optionsContainer) { + itemCtrl.optionsContainer = jqLite(ITEM_TPL_OPTION_BUTTONS); + itemCtrl.$element.append(itemCtrl.optionsContainer); + } + itemCtrl.optionsContainer.append($element); + + //Don't bubble click up to main .item + $element.on('click', stopPropagation); + }; + } + }; }]); diff --git a/js/angular/directive/list.js b/js/angular/directive/list.js index 94dbbd624b..69e0905f20 100644 --- a/js/angular/directive/list.js +++ b/js/angular/directive/list.js @@ -74,8 +74,8 @@ */ IonicModule .directive('ionList', [ -'$animate', -'$timeout', + '$animate', + '$timeout', function($animate, $timeout) { return { restrict: 'E',