summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorMarc Hartmayer <hello@hartmayer.com>2020-04-23 02:09:01 +0200
committerMarc Hartmayer <hello@hartmayer.com>2020-04-23 03:02:03 +0200
commit6476503137fc41cf52e913aa33aed6bb1abaac6a (patch)
tree2e578e709706934e908af36c3cb1bdb4f68b9848 /client
parent981ed546f1cae45ad8b92b393ee29c1a26277f32 (diff)
downloadwekan-6476503137fc41cf52e913aa33aed6bb1abaac6a.tar.gz
wekan-6476503137fc41cf52e913aa33aed6bb1abaac6a.tar.bz2
wekan-6476503137fc41cf52e913aa33aed6bb1abaac6a.zip
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
Diffstat (limited to 'client')
-rw-r--r--client/components/boards/boardBody.js5
-rw-r--r--client/components/cards/minicard.jade4
-rw-r--r--client/components/lists/list.js6
-rw-r--r--client/components/lists/listHeader.jade3
-rw-r--r--client/components/swimlanes/swimlanes.js9
5 files changed, 12 insertions, 15 deletions
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() {
diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade
index 0b881a54..b6ccd4d7 100644
--- a/client/components/cards/minicard.jade
+++ b/client/components/cards/minicard.jade
@@ -4,8 +4,8 @@ template(name="minicard")
class="{{#if isLinkedBoard}}linked-board{{/if}}"
class="minicard-{{colorClass}}")
if isMiniScreen
- //.handle
- // .fa.fa-arrows
+ .handle
+ .fa.fa-arrows
unless isMiniScreen
if showDesktopDragHandles
.handle
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(),
);
diff --git a/client/components/lists/listHeader.jade b/client/components/lists/listHeader.jade
index 182fee9e..fa1faf34 100644
--- a/client/components/lists/listHeader.jade
+++ b/client/components/lists/listHeader.jade
@@ -30,10 +30,9 @@ template(name="listHeader")
if canSeeAddCard
a.js-add-card.fa.fa-plus.list-header-plus-icon
a.fa.fa-navicon.js-open-list-menu
- //a.list-header-handle.handle.fa.fa-arrows.js-list-handle
else
a.list-header-menu-icon.fa.fa-angle-right.js-select-list
- //a.list-header-handle.handle.fa.fa-arrows.js-list-handle
+ a.list-header-handle.handle.fa.fa-arrows.js-list-handle
else if currentUser.isBoardMember
if isWatching
i.list-header-watch-icon.fa.fa-eye
diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js
index 577bf6d2..2d299ddc 100644
--- a/client/components/swimlanes/swimlanes.js
+++ b/client/components/swimlanes/swimlanes.js
@@ -111,7 +111,7 @@ function initSortable(boardComponent, $listsDom) {
showDesktopDragHandles = false;
}
- if (!Utils.isMiniScreen() && showDesktopDragHandles) {
+ if (Utils.isMiniScreen() || showDesktopDragHandles) {
$listsDom.sortable({
handle: '.js-list-handle',
});
@@ -126,8 +126,8 @@ function initSortable(boardComponent, $listsDom) {
$listsDom.sortable(
'option',
'disabled',
- // Disable drag-dropping when user is not member/is worker/is miniscreen
- !userIsMember() || Meteor.user().isWorker() || Utils.isMiniScreen(),
+ // Disable drag-dropping when user is not member/is worker
+ !userIsMember() || Meteor.user().isWorker(),
// Not disable drag-dropping while in multi-selection mode
// MultiSelection.isActive() || !userIsMember(),
);
@@ -188,8 +188,7 @@ BlazeComponent.extendComponent({
}
const noDragInside = ['a', 'input', 'textarea', 'p'].concat(
- Utils.isMiniScreen() ||
- (!Utils.isMiniScreen() && showDesktopDragHandles)
+ Utils.isMiniScreen() || showDesktopDragHandles
? ['.js-list-handle', '.js-swimlane-header-handle']
: ['.js-list-header'],
);