From 2bf004120d5a43cd3c3c060fc7c0c30d1b01f220 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 3 Jan 2020 06:49:35 +0200 Subject: Add Worker role. Add more Font Awesome icons. Fix browser console errors when editing user profile name etc. Thanks to xet7 ! Closes #2788 --- client/components/lists/list.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'client/components/lists/list.js') diff --git a/client/components/lists/list.js b/client/components/lists/list.js index 89d51e85..0513f90f 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -176,12 +176,10 @@ Template.list.helpers({ currentUser = Meteor.user(); if (currentUser) { return (currentUser.profile || {}).showDesktopDragHandles; + } else if (cookies.has('showDesktopDragHandles')) { + return true; } else { - if (cookies.has('showDesktopDragHandles')) { - return true; - } else { - return false; - } + return false; } }, }); -- cgit v1.2.3-1-g7c22 From bf78b093bad7d463ee325ad96e8b485264d4a3be Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 7 Feb 2020 03:16:16 +0200 Subject: Try to disable dragging Swimlanes/Lists/Cards/Checklists/Subtasks on small mobile smartphones webbrowsers, and hide drag handles on mobile web. Thanks to xet7 ! --- client/components/lists/list.js | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'client/components/lists/list.js') diff --git a/client/components/lists/list.js b/client/components/lists/list.js index 0513f90f..8574caf7 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -133,14 +133,33 @@ BlazeComponent.extendComponent({ $cards.sortable({ handle: '.handle', }); - } else { + } else if (!Utils.isMiniScreen() && !showDesktopDragHandles) { $cards.sortable({ handle: '.minicard', }); } - // Disable drag-dropping if the current user is not a board member or is comment only - $cards.sortable('option', 'disabled', !userIsMember()); + if ($cards.data('sortable')) { + $cards.sortable( + 'option', + 'disabled', + // Disable drag-dropping when user is not member/is miniscreen + !userIsMember(), + // Not disable drag-dropping while in multi-selection mode + // MultiSelection.isActive() || !userIsMember(), + ); + } + + if ($cards.data('sortable')) { + $cards.sortable( + 'option', + 'disabled', + // Disable drag-dropping when user is not member/is miniscreen + Utils.isMiniScreen(), + // Not disable drag-dropping while in multi-selection mode + // MultiSelection.isActive() || !userIsMember(), + ); + } }); // We want to re-run this function any time a card is added. -- cgit v1.2.3-1-g7c22 From 981ed546f1cae45ad8b92b393ee29c1a26277f32 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Thu, 23 Apr 2020 00:54:39 +0200 Subject: Newer versions of jQuery sortable use `uiSortable` key Newer versions of jQuery sortable use `uiSortable` as key to store the data. Let's adapt the code. While at it, refactor the code. --- client/components/lists/list.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'client/components/lists/list.js') diff --git a/client/components/lists/list.js b/client/components/lists/list.js index 8574caf7..7ce520dc 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -139,23 +139,12 @@ BlazeComponent.extendComponent({ }); } - if ($cards.data('sortable')) { + if ($cards.data('uiSortable')) { $cards.sortable( 'option', 'disabled', // Disable drag-dropping when user is not member/is miniscreen - !userIsMember(), - // Not disable drag-dropping while in multi-selection mode - // MultiSelection.isActive() || !userIsMember(), - ); - } - - if ($cards.data('sortable')) { - $cards.sortable( - 'option', - 'disabled', - // Disable drag-dropping when user is not member/is miniscreen - Utils.isMiniScreen(), + !userIsMember() || Utils.isMiniScreen(), // Not disable drag-dropping while in multi-selection mode // MultiSelection.isActive() || !userIsMember(), ); -- cgit v1.2.3-1-g7c22 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/lists/list.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'client/components/lists/list.js') diff --git a/client/components/lists/list.js b/client/components/lists/list.js index 7ce520dc..a0031b2f 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -129,7 +129,7 @@ BlazeComponent.extendComponent({ showDesktopDragHandles = false; } - if (!Utils.isMiniScreen() && showDesktopDragHandles) { + if (Utils.isMiniScreen() || showDesktopDragHandles) { $cards.sortable({ handle: '.handle', }); @@ -143,8 +143,8 @@ BlazeComponent.extendComponent({ $cards.sortable( 'option', 'disabled', - // Disable drag-dropping when user is not member/is miniscreen - !userIsMember() || Utils.isMiniScreen(), + // Disable drag-dropping when user is not member + !userIsMember(), // Not disable drag-dropping while in multi-selection mode // MultiSelection.isActive() || !userIsMember(), ); -- cgit v1.2.3-1-g7c22 From 6d1cdebfe214c7f67f8cc396cf880d1b5a18f013 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Sat, 25 Apr 2020 09:48:56 +0200 Subject: Make it compatible with newer and older versions of jQuery sortable While at it, fix comments and prettify it. --- client/components/lists/list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/components/lists/list.js') diff --git a/client/components/lists/list.js b/client/components/lists/list.js index a0031b2f..1f622b86 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -139,7 +139,7 @@ BlazeComponent.extendComponent({ }); } - if ($cards.data('uiSortable')) { + if ($cards.data('uiSortable') || $cards.data('sortable')) { $cards.sortable( 'option', 'disabled', -- 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/lists/list.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'client/components/lists/list.js') diff --git a/client/components/lists/list.js b/client/components/lists/list.js index 1f622b86..839304f8 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -1,6 +1,6 @@ import { Cookies } from 'meteor/ostrio:cookies'; const cookies = new Cookies(); -const { calculateIndex, enableClickOnTouch } = Utils; +const { calculateIndex } = Utils; BlazeComponent.extendComponent({ // Proxy @@ -114,9 +114,6 @@ BlazeComponent.extendComponent({ }, }); - // ugly touch event hotfix - enableClickOnTouch(itemsSelector); - this.autorun(() => { let showDesktopDragHandles = false; currentUser = Meteor.user(); -- cgit v1.2.3-1-g7c22