From 0594d7650bfdb60b3ff3ed5fd5cee6c1e98b7361 Mon Sep 17 00:00:00 2001 From: Joey Arnold Date: Mon, 4 Jan 2016 22:46:50 -0700 Subject: [PATCH] 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. --- components/ionSlideBox/ionSlideBox.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/ionSlideBox/ionSlideBox.js b/components/ionSlideBox/ionSlideBox.js index 7b7ca82..7768da5 100644 --- a/components/ionSlideBox/ionSlideBox.js +++ b/components/ionSlideBox/ionSlideBox.js @@ -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 () { @@ -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(); + } + } +}); \ No newline at end of file