This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Problem: an Hammer.JS instance listens to the horizontal swipe gestures | |
* targeted at a top-level html element (e.g.: body) in order to show/hide | |
* an off-canvas menu; it should be possible to browse a touch-enabled carousel | |
* placed in the same page (e.g.: RoyalSlider, Owl Carousel or similar) without | |
* interfering with the above listener. | |
* | |
* Solution: enable Hammer.JS custom DOM events and prevent any "swipe" gesture | |
* from bubbling up to the body element by stopping event propagation via listeners | |
* attached to each nested touch-enabled element (e.g.: the carousel) |