From 6476503137fc41cf52e913aa33aed6bb1abaac6a Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Thu, 23 Apr 2020 02:09:01 +0200 Subject: Fix drag-and-drop and scrolling on mobile devices Use drag handles on "miniscreens" whenever useful, this is especially useful on mobile device. This should hopefully fix https://github.com/wekan/wekan/issues/2947. While at it, simplify the condition Utils.isMiniScreen() || (!Utils.isMiniScreen() && showDesktopDragHandles) to Utils.isMiniScreen() || showDesktopDragHandle --- client/components/boards/boardBody.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index e70a9f67..29922fcc 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -205,7 +205,7 @@ BlazeComponent.extendComponent({ } else { showDesktopDragHandles = false; } - if (!Utils.isMiniScreen() && showDesktopDragHandles) { + if (Utils.isMiniScreen() || showDesktopDragHandles) { $swimlanesDom.sortable({ handle: '.js-swimlane-header-handle', }); @@ -215,9 +215,8 @@ BlazeComponent.extendComponent({ }); } - // Disable drag-dropping if the current user is not a board member or is miniscreen + // Disable drag-dropping if the current user is not a board member $swimlanesDom.sortable('option', 'disabled', !userIsMember()); - $swimlanesDom.sortable('option', 'disabled', Utils.isMiniScreen()); }); function userIsMember() { -- cgit v1.2.3-1-g7c22 From f1b18d79cdbfd9c9edecf4f93a89e88ee1c6faea Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Fri, 24 Apr 2020 22:41:24 +0200 Subject: Don't interpret dragging an element as a click Remove `enableClickOnTouch` as this behavior is not intuitive. --- client/components/boards/boardBody.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'client/components/boards/boardBody.js') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 29922fcc..4e473f18 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -1,7 +1,7 @@ import { Cookies } from 'meteor/ostrio:cookies'; const cookies = new Cookies(); const subManager = new SubsManager(); -const { calculateIndex, enableClickOnTouch } = Utils; +const { calculateIndex } = Utils; const swimlaneWhileSortingHeight = 150; BlazeComponent.extendComponent({ @@ -191,9 +191,6 @@ BlazeComponent.extendComponent({ }, }); - // ugly touch event hotfix - enableClickOnTouch('.js-swimlane:not(.placeholder)'); - this.autorun(() => { let showDesktopDragHandles = false; currentUser = Meteor.user(); -- cgit v1.2.3-1-g7c22