diff --git a/api/js/tapandswipe.ts b/api/js/tapandswipe.ts index ffa49ebb0b..32ed8bd814 100644 --- a/api/js/tapandswipe.ts +++ b/api/js/tapandswipe.ts @@ -31,7 +31,7 @@ export class tapAndSwipe { static readonly _default : TapAndSwipeOptionsType = { threshold : 10, tapHoldThreshold : 3000, - allowScrolling : null, + allowScrolling : 'both', swipe : function(){}, tap : function(){}, tapAndHold: function(){} @@ -125,9 +125,9 @@ export class tapAndSwipe { this._isTapAndHold = false; this._fingercount = event.touches.length; - if(event.path) + if(event.composedPath()) { - const scrolledItem = event.path.filter(_item => { + const scrolledItem = event.composedPath().filter(_item => { return _item instanceof HTMLElement && this.element.contains(_item) && (_item.scrollTop != 0 || _item.scrollLeft !=0); }); if (scrolledItem.length>0) @@ -140,8 +140,6 @@ export class tapAndSwipe { } } - - this._tapHoldTimeout = window.setTimeout(_=>{ this._isTapAndHold = true; //check scrolling diff --git a/pixelegg/js/fw_mobile.js b/pixelegg/js/fw_mobile.js index eff854cf58..16192dcfb1 100644 --- a/pixelegg/js/fw_mobile.js +++ b/pixelegg/js/fw_mobile.js @@ -81,14 +81,16 @@ import {tapAndSwipe} from "../../api/js/tapandswipe"; $baseDiv.css('overflow-y','auto'); break; case "left": - if (distance >= 10) + if (distance >= 200) { framework.toggleMenu(); } - break; case "right": - framework.toggleMenu(); + if (distance >= 200) + { + framework.toggleMenu(); + } } }, allScrolling: 'vertical'