summaryrefslogtreecommitdiffstats
path: root/client/lib
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-01-03 06:49:35 +0200
committerLauri Ojansivu <x@xet7.org>2020-01-03 06:49:35 +0200
commit2bf004120d5a43cd3c3c060fc7c0c30d1b01f220 (patch)
treea37e06277fa2ce240c06023d679c5fbef001e7a4 /client/lib
parent0709b5abc84714e8c87ef27f5f0841c2a38e6d68 (diff)
downloadwekan-2bf004120d5a43cd3c3c060fc7c0c30d1b01f220.tar.gz
wekan-2bf004120d5a43cd3c3c060fc7c0c30d1b01f220.tar.bz2
wekan-2bf004120d5a43cd3c3c060fc7c0c30d1b01f220.zip
Add Worker role.
Add more Font Awesome icons. Fix browser console errors when editing user profile name etc. Thanks to xet7 ! Closes #2788
Diffstat (limited to 'client/lib')
-rw-r--r--client/lib/utils.js40
1 files changed, 18 insertions, 22 deletions
diff --git a/client/lib/utils.js b/client/lib/utils.js
index f4fc170a..39457208 100644
--- a/client/lib/utils.js
+++ b/client/lib/utils.js
@@ -24,18 +24,14 @@ Utils = {
currentUser = Meteor.user();
if (currentUser) {
return (currentUser.profile || {}).boardView;
+ } else if (cookies.get('boardView') === 'board-view-lists') {
+ return 'board-view-lists';
+ } else if (cookies.get('boardView') === 'board-view-swimlanes') {
+ return 'board-view-swimlanes';
+ } else if (cookies.get('boardView') === 'board-view-cal') {
+ return 'board-view-cal';
} else {
- if (cookies.get('boardView') === 'board-view-lists') {
- return 'board-view-lists';
- } else if (
- cookies.get('boardView') === 'board-view-swimlanes'
- ) {
- return 'board-view-swimlanes';
- } else if (cookies.get('boardView') === 'board-view-cal') {
- return 'board-view-cal';
- } else {
- return false;
- }
+ return false;
}
},
@@ -43,8 +39,8 @@ Utils = {
goBoardId(_id) {
const board = Boards.findOne(_id);
return (
- board
- && FlowRouter.go('board', {
+ board &&
+ FlowRouter.go('board', {
id: board._id,
slug: board.slug,
})
@@ -55,8 +51,8 @@ Utils = {
const card = Cards.findOne(_id);
const board = Boards.findOne(card.boardId);
return (
- board
- && FlowRouter.go('card', {
+ board &&
+ FlowRouter.go('card', {
cardId: card._id,
boardId: board._id,
slug: board.slug,
@@ -227,8 +223,8 @@ Utils = {
};
if (
- 'ontouchstart' in window
- || (window.DocumentTouch && document instanceof window.DocumentTouch)
+ 'ontouchstart' in window ||
+ (window.DocumentTouch && document instanceof window.DocumentTouch)
) {
return true;
}
@@ -249,8 +245,8 @@ Utils = {
calculateTouchDistance(touchA, touchB) {
return Math.sqrt(
- Math.pow(touchA.screenX - touchB.screenX, 2)
- + Math.pow(touchA.screenY - touchB.screenY, 2),
+ Math.pow(touchA.screenX - touchB.screenX, 2) +
+ Math.pow(touchA.screenY - touchB.screenY, 2),
);
},
@@ -267,9 +263,9 @@ Utils = {
});
$(document).on('touchend', selector, function(e) {
if (
- touchStart
- && lastTouch
- && Utils.calculateTouchDistance(touchStart, lastTouch) <= 20
+ touchStart &&
+ lastTouch &&
+ Utils.calculateTouchDistance(touchStart, lastTouch) <= 20
) {
e.preventDefault();
const clickEvent = document.createEvent('MouseEvents');