Skip to content

Commit

Permalink
Fix the event propagation when there are nested draggable items.
Browse files Browse the repository at this point in the history
For instance, ionSlideBox inside ionSideMenu. If developer
still wants the propagation, simply pass stopPropagation=false
to ionSlideBox.
  • Loading branch information
Joey Arnold committed Jan 9, 2016
1 parent dac4025 commit 0594d76
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/ionSlideBox/ionSlideBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Template.ionSlideBox.created = function () {
this.slideInterval = this.data.slideInterval || 4000;
this.showPager = typeof this.data.showPager != 'undefined' ? this.data.showPager : true;
this.initialSlide = this.data.initialSlide || Session.get('ion-slide-initial-slide') || 0;
this.preventPropagation = this.data.preventPropagation || true;
};

Template.ionSlideBox.rendered = function () {
Expand All @@ -29,3 +30,11 @@ Template.ionSlideBox.destroyed = function () {
var $slideBox = this.$('.ion-slide-box');
if ($slideBox.hasClass('slick-initialized')) $slideBox.slick('unslick');
};

Template.ionSlideBox.events({
'touchmove .ion-slide-box': function(event, template) {
if (template.preventPropagation) {
event.stopPropagation();
}
}
});

0 comments on commit 0594d76

Please sign in to comment.