Skip to content

Commit

Permalink
fix(ionDeleteButton): stop clicks from bubbling up to main item
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Apr 20, 2015
1 parent edb62c2 commit 0421596
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/angular/directive/itemDeleteButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ var ITEM_TPL_DELETE_BUTTON =
*/
IonicModule
.directive('ionDeleteButton', function() {

function stopPropagation(ev) {
ev.stopPropagation();
}

return {
restrict: 'E',
require: ['^^ionItem', '^?ionList'],
Expand All @@ -48,6 +53,9 @@ IonicModule
container.append($element);
itemCtrl.$element.append(container).addClass('item-left-editable');

//Don't bubble click up to main .item
$element.on('click', stopPropagation);

init();
$scope.$on('$ionic.reconnectScope', init);
function init() {
Expand Down

0 comments on commit 0421596

Please sign in to comment.