mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
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
This commit is contained in:
parent
981ed546f1
commit
6476503137
5 changed files with 12 additions and 15 deletions
|
|
@ -205,7 +205,7 @@ BlazeComponent.extendComponent({
|
||||||
} else {
|
} else {
|
||||||
showDesktopDragHandles = false;
|
showDesktopDragHandles = false;
|
||||||
}
|
}
|
||||||
if (!Utils.isMiniScreen() && showDesktopDragHandles) {
|
if (Utils.isMiniScreen() || showDesktopDragHandles) {
|
||||||
$swimlanesDom.sortable({
|
$swimlanesDom.sortable({
|
||||||
handle: '.js-swimlane-header-handle',
|
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', !userIsMember());
|
||||||
$swimlanesDom.sortable('option', 'disabled', Utils.isMiniScreen());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function userIsMember() {
|
function userIsMember() {
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ template(name="minicard")
|
||||||
class="{{#if isLinkedBoard}}linked-board{{/if}}"
|
class="{{#if isLinkedBoard}}linked-board{{/if}}"
|
||||||
class="minicard-{{colorClass}}")
|
class="minicard-{{colorClass}}")
|
||||||
if isMiniScreen
|
if isMiniScreen
|
||||||
//.handle
|
.handle
|
||||||
// .fa.fa-arrows
|
.fa.fa-arrows
|
||||||
unless isMiniScreen
|
unless isMiniScreen
|
||||||
if showDesktopDragHandles
|
if showDesktopDragHandles
|
||||||
.handle
|
.handle
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ BlazeComponent.extendComponent({
|
||||||
showDesktopDragHandles = false;
|
showDesktopDragHandles = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Utils.isMiniScreen() && showDesktopDragHandles) {
|
if (Utils.isMiniScreen() || showDesktopDragHandles) {
|
||||||
$cards.sortable({
|
$cards.sortable({
|
||||||
handle: '.handle',
|
handle: '.handle',
|
||||||
});
|
});
|
||||||
|
|
@ -143,8 +143,8 @@ BlazeComponent.extendComponent({
|
||||||
$cards.sortable(
|
$cards.sortable(
|
||||||
'option',
|
'option',
|
||||||
'disabled',
|
'disabled',
|
||||||
// Disable drag-dropping when user is not member/is miniscreen
|
// Disable drag-dropping when user is not member
|
||||||
!userIsMember() || Utils.isMiniScreen(),
|
!userIsMember(),
|
||||||
// Not disable drag-dropping while in multi-selection mode
|
// Not disable drag-dropping while in multi-selection mode
|
||||||
// MultiSelection.isActive() || !userIsMember(),
|
// MultiSelection.isActive() || !userIsMember(),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,9 @@ template(name="listHeader")
|
||||||
if canSeeAddCard
|
if canSeeAddCard
|
||||||
a.js-add-card.fa.fa-plus.list-header-plus-icon
|
a.js-add-card.fa.fa-plus.list-header-plus-icon
|
||||||
a.fa.fa-navicon.js-open-list-menu
|
a.fa.fa-navicon.js-open-list-menu
|
||||||
//a.list-header-handle.handle.fa.fa-arrows.js-list-handle
|
|
||||||
else
|
else
|
||||||
a.list-header-menu-icon.fa.fa-angle-right.js-select-list
|
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
|
else if currentUser.isBoardMember
|
||||||
if isWatching
|
if isWatching
|
||||||
i.list-header-watch-icon.fa.fa-eye
|
i.list-header-watch-icon.fa.fa-eye
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ function initSortable(boardComponent, $listsDom) {
|
||||||
showDesktopDragHandles = false;
|
showDesktopDragHandles = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Utils.isMiniScreen() && showDesktopDragHandles) {
|
if (Utils.isMiniScreen() || showDesktopDragHandles) {
|
||||||
$listsDom.sortable({
|
$listsDom.sortable({
|
||||||
handle: '.js-list-handle',
|
handle: '.js-list-handle',
|
||||||
});
|
});
|
||||||
|
|
@ -126,8 +126,8 @@ function initSortable(boardComponent, $listsDom) {
|
||||||
$listsDom.sortable(
|
$listsDom.sortable(
|
||||||
'option',
|
'option',
|
||||||
'disabled',
|
'disabled',
|
||||||
// Disable drag-dropping when user is not member/is worker/is miniscreen
|
// Disable drag-dropping when user is not member/is worker
|
||||||
!userIsMember() || Meteor.user().isWorker() || Utils.isMiniScreen(),
|
!userIsMember() || Meteor.user().isWorker(),
|
||||||
// Not disable drag-dropping while in multi-selection mode
|
// Not disable drag-dropping while in multi-selection mode
|
||||||
// MultiSelection.isActive() || !userIsMember(),
|
// MultiSelection.isActive() || !userIsMember(),
|
||||||
);
|
);
|
||||||
|
|
@ -188,8 +188,7 @@ BlazeComponent.extendComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
const noDragInside = ['a', 'input', 'textarea', 'p'].concat(
|
const noDragInside = ['a', 'input', 'textarea', 'p'].concat(
|
||||||
Utils.isMiniScreen() ||
|
Utils.isMiniScreen() || showDesktopDragHandles
|
||||||
(!Utils.isMiniScreen() && showDesktopDragHandles)
|
|
||||||
? ['.js-list-handle', '.js-swimlane-header-handle']
|
? ['.js-list-handle', '.js-swimlane-header-handle']
|
||||||
: ['.js-list-header'],
|
: ['.js-list-header'],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue