From 22f41e7cb417fea2326f3475f5c7be21926639fb Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 2 Jun 2022 12:02:43 +0200 Subject: [PATCH] Replace another jquery-ui swipe with tapAndSwipe --- pixelegg/js/fw_mobile.js | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/pixelegg/js/fw_mobile.js b/pixelegg/js/fw_mobile.js index 5ed5febe46..2b4f83a287 100644 --- a/pixelegg/js/fw_mobile.js +++ b/pixelegg/js/fw_mobile.js @@ -22,6 +22,7 @@ import '../../api/js/framework/fw_ui.js'; import '../../api/js/framework/fw_classes.js'; import '../../api/js/jsapi/egw_inheritance.js'; import '../../vendor/bower-asset/fastclick/lib/fastclick.js'; +import {tapAndSwipe} from "../../api/js/tapandswipe"; /** * * @param {DOMWindow} window @@ -69,10 +70,9 @@ import '../../vendor/bower-asset/fastclick/lib/fastclick.js'; { this._super.apply(this,arguments); var $baseDiv = jQuery(this.baseDiv); - /*$baseDiv.swipe({ - swipe: function (e, direction,distance) + let swipe = new tapAndSwipe(this.baseDiv, { + swipe: function(e, direction, distance) { - switch (direction) { case "up": @@ -87,21 +87,12 @@ import '../../vendor/bower-asset/fastclick/lib/fastclick.js'; } break; - case "right": - framework.toggleMenu(); + case "right": + framework.toggleMenu(); } }, - swipeStatus:function(event, phase, direction, distance, duration, fingers) - { - switch (phase) - { - case "move": - //TODO: implement smooth swip - - } - }, - allowPageScroll: "vertical" - });*/ + allScrolling: 'vertical' + }); }, /** * Adds an entry to the sidemenu.