Skip to content

Commit 0594d76

Browse files
author
Joey Arnold
committed
Fix the event propagation when there are nested draggable items.
For instance, ionSlideBox inside ionSideMenu. If developer still wants the propagation, simply pass stopPropagation=false to ionSlideBox.
1 parent dac4025 commit 0594d76

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

components/ionSlideBox/ionSlideBox.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Template.ionSlideBox.created = function () {
55
this.slideInterval = this.data.slideInterval || 4000;
66
this.showPager = typeof this.data.showPager != 'undefined' ? this.data.showPager : true;
77
this.initialSlide = this.data.initialSlide || Session.get('ion-slide-initial-slide') || 0;
8+
this.preventPropagation = this.data.preventPropagation || true;
89
};
910

1011
Template.ionSlideBox.rendered = function () {
@@ -29,3 +30,11 @@ Template.ionSlideBox.destroyed = function () {
2930
var $slideBox = this.$('.ion-slide-box');
3031
if ($slideBox.hasClass('slick-initialized')) $slideBox.slick('unslick');
3132
};
33+
34+
Template.ionSlideBox.events({
35+
'touchmove .ion-slide-box': function(event, template) {
36+
if (template.preventPropagation) {
37+
event.stopPropagation();
38+
}
39+
}
40+
});

0 commit comments

Comments
 (0)