summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-04-25 14:15:58 +0300
committerGitHub <noreply@github.com>2020-04-25 14:15:58 +0300
commita84195179ef9dc859f5e91d56a2f4f528aba00a5 (patch)
treefc73df848d715ba915f70bf4cc990135b59eadba
parent7cf8487f57058ee7dc4835793b4d51302d145761 (diff)
parentf1b18d79cdbfd9c9edecf4f93a89e88ee1c6faea (diff)
downloadwekan-a84195179ef9dc859f5e91d56a2f4f528aba00a5.tar.gz
wekan-a84195179ef9dc859f5e91d56a2f4f528aba00a5.tar.bz2
wekan-a84195179ef9dc859f5e91d56a2f4f528aba00a5.zip
Merge pull request #3045 from marc1006/mobile_followup
Follow-up for https://github.com/wekan/wekan/pull/3040
-rw-r--r--client/components/boards/boardBody.js5
-rw-r--r--client/components/boards/boardsList.js5
-rw-r--r--client/components/cards/cardDetails.js12
-rw-r--r--client/components/cards/checklists.js15
-rw-r--r--client/components/lists/list.js7
-rw-r--r--client/components/swimlanes/swimlanes.js7
6 files changed, 17 insertions, 34 deletions
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();
diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js
index 9208fdb2..df319ce0 100644
--- a/client/components/boards/boardsList.js
+++ b/client/components/boards/boardsList.js
@@ -1,5 +1,5 @@
const subManager = new SubsManager();
-const { calculateIndex, enableClickOnTouch } = Utils;
+const { calculateIndex } = Utils;
Template.boardListHeaderBar.events({
'click .js-open-archived-board'() {
@@ -68,9 +68,6 @@ BlazeComponent.extendComponent({
},
});
- // ugly touch event hotfix
- enableClickOnTouch(itemsSelector);
-
// Disable drag-dropping if the current user is not a board member or is comment only
this.autorun(() => {
$boards.sortable('option', 'disabled', !userIsAllowedToMove());
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 8fc3c12a..f31c3890 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -1,5 +1,5 @@
const subManager = new SubsManager();
-const { calculateIndexData, enableClickOnTouch } = Utils;
+const { calculateIndexData } = Utils;
let cardColors;
Meteor.startup(() => {
@@ -231,9 +231,6 @@ BlazeComponent.extendComponent({
},
});
- // ugly touch event hotfix
- enableClickOnTouch('.card-checklist-items .js-checklist');
-
const $subtasksDom = this.$('.card-subtasks-items');
$subtasksDom.sortable({
@@ -269,9 +266,6 @@ BlazeComponent.extendComponent({
},
});
- // ugly touch event hotfix
- enableClickOnTouch('.card-subtasks-items .js-subtasks');
-
function userIsMember() {
return Meteor.user() && Meteor.user().isBoardMember();
}
@@ -279,10 +273,10 @@ BlazeComponent.extendComponent({
// Disable sorting if the current user is not a board member
this.autorun(() => {
const disabled = !userIsMember() || Utils.isMiniScreen();
- if ($checklistsDom.data('uiSortable')) {
+ if ($checklistsDom.data('uiSortable') || $checklistsDom.data('sortable')) {
$checklistsDom.sortable('option', 'disabled', disabled);
}
- if ($subtasksDom.data('uiSortable')) {
+ if ($subtasksDom.data('uiSortable') || $subtasksDom.data('sortable')) {
$subtasksDom.sortable('option', 'disabled', disabled);
}
});
diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js
index 8daf6ee7..29573d2b 100644
--- a/client/components/cards/checklists.js
+++ b/client/components/cards/checklists.js
@@ -1,4 +1,4 @@
-const { calculateIndexData, enableClickOnTouch, capitalize } = Utils;
+const { calculateIndexData, capitalize } = Utils;
function initSorting(items) {
items.sortable({
@@ -36,9 +36,6 @@ function initSorting(items) {
checklistItem.move(checklistId, sortIndex.base);
},
});
-
- // ugly touch event hotfix
- enableClickOnTouch('.js-checklist-item:not(.placeholder)');
}
BlazeComponent.extendComponent({
@@ -54,11 +51,15 @@ BlazeComponent.extendComponent({
return Meteor.user() && Meteor.user().isBoardMember();
}
- // Disable sorting if the current user is not a board member
+ // Disable sorting if the current user is not a board member or is a miniscreen
self.autorun(() => {
const $itemsDom = $(self.itemsDom);
- if ($itemsDom.data('uiSortable')) {
- $(self.itemsDom).sortable('option', 'disabled', !userIsMember() || Utils.isMiniScreen());
+ if ($itemsDom.data('uiSortable') || $itemsDom.data('sortable')) {
+ $(self.itemsDom).sortable(
+ 'option',
+ 'disabled',
+ !userIsMember() || Utils.isMiniScreen(),
+ );
}
});
},
diff --git a/client/components/lists/list.js b/client/components/lists/list.js
index a0031b2f..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();
@@ -139,7 +136,7 @@ BlazeComponent.extendComponent({
});
}
- if ($cards.data('uiSortable')) {
+ if ($cards.data('uiSortable') || $cards.data('sortable')) {
$cards.sortable(
'option',
'disabled',
diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js
index 2d299ddc..753fa88b 100644
--- a/client/components/swimlanes/swimlanes.js
+++ b/client/components/swimlanes/swimlanes.js
@@ -1,6 +1,6 @@
import { Cookies } from 'meteor/ostrio:cookies';
const cookies = new Cookies();
-const { calculateIndex, enableClickOnTouch } = Utils;
+const { calculateIndex } = Utils;
function currentListIsInThisSwimlane(swimlaneId) {
const currentList = Lists.findOne(Session.get('currentList'));
@@ -87,9 +87,6 @@ function initSortable(boardComponent, $listsDom) {
},
});
- // ugly touch event hotfix
- enableClickOnTouch('.js-list:not(.js-list-composer)');
-
function userIsMember() {
return (
Meteor.user() &&
@@ -122,7 +119,7 @@ function initSortable(boardComponent, $listsDom) {
}
const $listDom = $listsDom;
- if ($listDom.data('uiSortable')) {
+ if ($listDom.data('uiSortable') || $listDom.data('sortable')) {
$listsDom.sortable(
'option',
'disabled',