summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/components/activities/comments.js3
-rw-r--r--client/components/boards/boardBody.js35
-rw-r--r--client/components/boards/boardHeader.jade12
-rw-r--r--client/components/boards/boardHeader.js12
-rw-r--r--client/components/cards/cardDetails.js6
-rw-r--r--client/components/cards/minicard.jade13
-rw-r--r--client/components/cards/minicard.js8
-rw-r--r--client/components/lists/list.js23
-rw-r--r--client/components/lists/listHeader.js22
-rw-r--r--client/components/settings/peopleBody.jade59
-rw-r--r--client/components/sidebar/sidebar.js6
-rw-r--r--client/components/swimlanes/swimlaneHeader.js4
-rw-r--r--client/components/swimlanes/swimlanes.jade22
-rw-r--r--client/components/swimlanes/swimlanes.js68
-rw-r--r--client/components/users/userHeader.js47
-rw-r--r--client/lib/utils.js15
16 files changed, 137 insertions, 218 deletions
diff --git a/client/components/activities/comments.js b/client/components/activities/comments.js
index 95084646..50ca019b 100644
--- a/client/components/activities/comments.js
+++ b/client/components/activities/comments.js
@@ -16,9 +16,6 @@ BlazeComponent.extendComponent({
events() {
return [
{
- 'click .js-new-comment:not(.focus)'() {
- commentFormIsOpen.set(true);
- },
'submit .js-new-comment-form'(evt) {
const input = this.getInput();
const text = input.val().trim();
diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js
index 41b6f4ef..55b8c0a1 100644
--- a/client/components/boards/boardBody.js
+++ b/client/components/boards/boardBody.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
const subManager = new SubsManager();
const { calculateIndex, enableClickOnTouch } = Utils;
const swimlaneWhileSortingHeight = 150;
@@ -192,9 +194,6 @@ BlazeComponent.extendComponent({
// ugly touch event hotfix
enableClickOnTouch('.js-swimlane:not(.placeholder)');
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
-
this.autorun(() => {
let showDesktopDragHandles = false;
currentUser = Meteor.user();
@@ -207,8 +206,8 @@ BlazeComponent.extendComponent({
showDesktopDragHandles = false;
}
if (
- Utils.isMiniScreen()
- || (!Utils.isMiniScreen() && showDesktopDragHandles)
+ Utils.isMiniScreen() ||
+ (!Utils.isMiniScreen() && showDesktopDragHandles)
) {
$swimlanesDom.sortable({
handle: '.js-swimlane-header-handle',
@@ -225,9 +224,9 @@ BlazeComponent.extendComponent({
function userIsMember() {
return (
- Meteor.user()
- && Meteor.user().isBoardMember()
- && !Meteor.user().isCommentOnly()
+ Meteor.user() &&
+ Meteor.user().isBoardMember() &&
+ !Meteor.user().isCommentOnly()
);
}
@@ -244,8 +243,6 @@ BlazeComponent.extendComponent({
if (currentUser) {
return (currentUser.profile || {}).boardView === 'board-view-swimlanes';
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
return cookies.get('boardView') === 'board-view-swimlanes';
}
},
@@ -255,8 +252,6 @@ BlazeComponent.extendComponent({
if (currentUser) {
return (currentUser.profile || {}).boardView === 'board-view-lists';
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
return cookies.get('boardView') === 'board-view-lists';
}
},
@@ -266,8 +261,6 @@ BlazeComponent.extendComponent({
if (currentUser) {
return (currentUser.profile || {}).boardView === 'board-view-cal';
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
return cookies.get('boardView') === 'board-view-cal';
}
},
@@ -306,16 +299,16 @@ BlazeComponent.extendComponent({
scrollLeft(position = 0) {
const swimlanes = this.$('.js-swimlanes');
- swimlanes
- && swimlanes.animate({
+ swimlanes &&
+ swimlanes.animate({
scrollLeft: position,
});
},
scrollTop(position = 0) {
const swimlanes = this.$('.js-swimlanes');
- swimlanes
- && swimlanes.animate({
+ swimlanes &&
+ swimlanes.animate({
scrollTop: position,
});
},
@@ -359,8 +352,8 @@ BlazeComponent.extendComponent({
end = end || card.endAt;
title = title || card.title;
const className =
- (extraCls ? `${extraCls} ` : '')
- + (card.color ? `calendar-event-${card.color}` : '');
+ (extraCls ? `${extraCls} ` : '') +
+ (card.color ? `calendar-event-${card.color}` : '');
events.push({
id: card._id,
title,
@@ -430,8 +423,6 @@ BlazeComponent.extendComponent({
if (currentUser) {
return (currentUser.profile || {}).boardView === 'board-view-cal';
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
return cookies.get('boardView') === 'board-view-cal';
}
},
diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade
index 39221778..53a74f76 100644
--- a/client/components/boards/boardHeader.jade
+++ b/client/components/boards/boardHeader.jade
@@ -103,14 +103,9 @@ template(name="boardHeaderBar")
i.fa.fa-trello
if $eq boardView 'board-view-swimlanes'
i.fa.fa-th-large
- // unless collapseSwimlane
- // i.fa.fa-th-large
- // if collapseSwimlane
- // i.fa.fa-play
if $eq boardView 'board-view-cal'
i.fa.fa-calendar
span {{#if boardView}}{{_ boardView}}{{else}}{{_ 'board-view-lists'}}{{/if}}
- //span {{#if collapseSwimlane}}{{_ 'board-view-collapse'}}{{else}}{{#if boardView}}{{_ boardView}}{{else}}{{_ 'board-view-lists'}}{{/if}}{{/if}}
if canModifyBoard
a.board-header-btn.js-multiselection-activate(
@@ -191,13 +186,6 @@ template(name="boardChangeViewPopup")
| {{_ 'board-view-swimlanes'}}
if $eq Utils.boardView "board-view-swimlanes"
i.fa.fa-check
- //li
- // with "board-view-collapse"
- // a.js-open-collapse-view
- // i.fa.fa-play.colorful
- // | {{_ 'board-view-collapse'}}
- // if $eq Utils.boardView "board-view-collapse"
- // i.fa.fa-check
li
with "board-view-cal"
a.js-open-cal-view
diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js
index ffbb9b72..eea43bd3 100644
--- a/client/components/boards/boardHeader.js
+++ b/client/components/boards/boardHeader.js
@@ -175,15 +175,6 @@ Template.boardHeaderBar.helpers({
boardView() {
return Utils.boardView();
},
- //collapseSwimlane() {
- // import { Cookies } from 'meteor/ostrio:cookies';
- // const cookies = new Cookies();
- // if (cookies.has('collapseSwimlane')) {
- // return true;
- // } else {
- // return false;
- // }
- //},
});
Template.boardChangeViewPopup.events({
@@ -195,9 +186,6 @@ Template.boardChangeViewPopup.events({
Utils.setBoardView('board-view-swimlanes');
Popup.close();
},
- //'click .js-open-collapse-view'() {
- // Utils.setBoardView('board-view-collapse');
- //Popup.close();
'click .js-open-cal-view'() {
Utils.setBoardView('board-view-cal');
Popup.close();
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 7bb54223..67120043 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -291,6 +291,8 @@ BlazeComponent.extendComponent({
.trim();
if (title) {
this.data().setTitle(title);
+ } else {
+ this.data().setTitle('');
}
},
'submit .js-card-details-assigner'(event) {
@@ -300,6 +302,8 @@ BlazeComponent.extendComponent({
.trim();
if (assigner) {
this.data().setAssignedBy(assigner);
+ } else {
+ this.data().setAssignedBy('');
}
},
'submit .js-card-details-requester'(event) {
@@ -309,6 +313,8 @@ BlazeComponent.extendComponent({
.trim();
if (requester) {
this.data().setRequestedBy(requester);
+ } else {
+ this.data().setRequestedBy('');
}
},
'click .js-member': Popup.open('cardMember'),
diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade
index 79672f8c..7dd220ee 100644
--- a/client/components/cards/minicard.jade
+++ b/client/components/cards/minicard.jade
@@ -67,14 +67,15 @@ template(name="minicard")
.minicard-custom-fields
each customFieldsWD
if definition.showOnCard
- .minicard-custom-field
- if definition.showLabelOnMiniCard
+ if trueValue
+ .minicard-custom-field
+ if definition.showLabelOnMiniCard
+ .minicard-custom-field-item
+ +viewer
+ = definition.name
.minicard-custom-field-item
+viewer
- = definition.name
- .minicard-custom-field-item
- +viewer
- = trueValue
+ = trueValue
if getAssignees
.minicard-assignees.js-minicard-assignees
diff --git a/client/components/cards/minicard.js b/client/components/cards/minicard.js
index a9f92dec..1ea608f5 100644
--- a/client/components/cards/minicard.js
+++ b/client/components/cards/minicard.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
// Template.cards.events({
// 'click .member': Popup.open('cardMember')
// });
@@ -18,8 +20,6 @@ BlazeComponent.extendComponent({
},
{
'click .js-toggle-minicard-label-text'() {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('hiddenMinicardLabelText')) {
cookies.remove('hiddenMinicardLabelText'); //true
} else {
@@ -37,8 +37,6 @@ Template.minicard.helpers({
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
return true;
} else {
@@ -51,8 +49,6 @@ Template.minicard.helpers({
if (currentUser) {
return (currentUser.profile || {}).hiddenMinicardLabelText;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('hiddenMinicardLabelText')) {
return true;
} else {
diff --git a/client/components/lists/list.js b/client/components/lists/list.js
index e58ea430..89d51e85 100644
--- a/client/components/lists/list.js
+++ b/client/components/lists/list.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
const { calculateIndex, enableClickOnTouch } = Utils;
BlazeComponent.extendComponent({
@@ -22,9 +24,9 @@ BlazeComponent.extendComponent({
function userIsMember() {
return (
- Meteor.user()
- && Meteor.user().isBoardMember()
- && !Meteor.user().isCommentOnly()
+ Meteor.user() &&
+ Meteor.user().isBoardMember() &&
+ !Meteor.user().isCommentOnly()
);
}
@@ -74,14 +76,14 @@ BlazeComponent.extendComponent({
const currentBoard = Boards.findOne(Session.get('currentBoard'));
let swimlaneId = '';
if (
- Utils.boardView() === 'board-view-swimlanes'
- || currentBoard.isTemplatesBoard()
+ Utils.boardView() === 'board-view-swimlanes' ||
+ currentBoard.isTemplatesBoard()
)
swimlaneId = Blaze.getData(ui.item.parents('.swimlane').get(0))._id;
else if (
- Utils.boardView() === 'board-view-lists'
- || Utils.boardView() === 'board-view-cal'
- || !Utils.boardView
+ Utils.boardView() === 'board-view-lists' ||
+ Utils.boardView() === 'board-view-cal' ||
+ !Utils.boardView
)
swimlaneId = currentBoard.getDefaultSwimline()._id;
@@ -115,9 +117,6 @@ BlazeComponent.extendComponent({
// ugly touch event hotfix
enableClickOnTouch(itemsSelector);
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
-
this.autorun(() => {
let showDesktopDragHandles = false;
currentUser = Meteor.user();
@@ -178,8 +177,6 @@ Template.list.helpers({
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
return true;
} else {
diff --git a/client/components/lists/listHeader.js b/client/components/lists/listHeader.js
index 34322fa9..570cc30f 100644
--- a/client/components/lists/listHeader.js
+++ b/client/components/lists/listHeader.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
let listsColors;
Meteor.startup(() => {
listsColors = Lists.simpleSchema()._schema.color.allowedValues;
@@ -7,9 +9,9 @@ BlazeComponent.extendComponent({
canSeeAddCard() {
const list = Template.currentData();
return (
- !list.getWipLimit('enabled')
- || list.getWipLimit('soft')
- || !this.reachedWipLimit()
+ !list.getWipLimit('enabled') ||
+ list.getWipLimit('soft') ||
+ !this.reachedWipLimit()
);
},
@@ -66,8 +68,8 @@ BlazeComponent.extendComponent({
reachedWipLimit() {
const list = Template.currentData();
return (
- list.getWipLimit('enabled')
- && list.getWipLimit('value') <= list.cards().count()
+ list.getWipLimit('enabled') &&
+ list.getWipLimit('value') <= list.cards().count()
);
},
@@ -108,8 +110,6 @@ Template.listHeader.helpers({
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
return true;
} else {
@@ -177,8 +177,8 @@ BlazeComponent.extendComponent({
const list = Template.currentData();
if (
- list.getWipLimit('soft')
- && list.getWipLimit('value') < list.cards().count()
+ list.getWipLimit('soft') &&
+ list.getWipLimit('value') < list.cards().count()
) {
list.setWipLimit(list.cards().count());
}
@@ -189,8 +189,8 @@ BlazeComponent.extendComponent({
const list = Template.currentData();
// Prevent user from using previously stored wipLimit.value if it is less than the current number of cards in the list
if (
- !list.getWipLimit('enabled')
- && list.getWipLimit('value') < list.cards().count()
+ !list.getWipLimit('enabled') &&
+ list.getWipLimit('value') < list.cards().count()
) {
list.setWipLimit(list.cards().count());
}
diff --git a/client/components/settings/peopleBody.jade b/client/components/settings/peopleBody.jade
index ff343e37..d8f672b0 100644
--- a/client/components/settings/peopleBody.jade
+++ b/client/components/settings/peopleBody.jade
@@ -39,26 +39,55 @@ template(name="peopleGeneral")
template(name="peopleRow")
tr
- td.username {{ userData.username }}
- td {{ userData.profile.fullname }}
- td
- if userData.isAdmin
- | {{_ 'yes'}}
- else
- | {{_ 'no'}}
- td {{ userData.emails.[0].address }}
- td
- if userData.emails.[0].verified
- | {{_ 'yes'}}
- else
- | {{_ 'no'}}
- td {{ moment userData.createdAt 'LLL' }}
+ if userData.loginDisabled
+ td.username <s>{{ userData.username }}</s>
+ else
+ td.username {{ userData.username }}
+ if userData.loginDisabled
+ td <s>{{ userData.profile.fullname }}</s>
+ else
+ td {{ userData.profile.fullname }}
+ if userData.loginDisabled
+ td
+ if userData.isAdmin
+ | <s>{{_ 'yes'}}</s>
+ else
+ | <s>{{_ 'no'}}</s>
+ else
+ td
+ if userData.isAdmin
+ | {{_ 'yes'}}
+ else
+ | {{_ 'no'}}
+ if userData.loginDisabled
+ td <s>{{ userData.emails.[0].address }}</s>
+ else
+ td {{ userData.emails.[0].address }}
+ if userData.loginDisabled
+ td
+ if userData.emails.[0].verified
+ | <s>{{_ 'yes'}}</s>
+ else
+ | <s>{{_ 'no'}}</s>
+ else
+ td
+ if userData.emails.[0].verified
+ | {{_ 'yes'}}
+ else
+ | {{_ 'no'}}
+ if userData.loginDisabled
+ td <s>{{ moment userData.createdAt 'LLL' }}</s>
+ else
+ td {{ moment userData.createdAt 'LLL' }}
td
if userData.loginDisabled
| {{_ 'no'}}
else
| {{_ 'yes'}}
- td {{_ userData.authenticationMethod }}
+ if userData.loginDisabled
+ td <s>{{_ userData.authenticationMethod }}</s>
+ else
+ td {{_ userData.authenticationMethod }}
td
a.edit-user
| {{_ 'edit'}}
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index 6bb22f39..caf36020 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
Sidebar = null;
const defaultView = 'home';
@@ -111,8 +113,6 @@ BlazeComponent.extendComponent({
if (currentUser) {
Meteor.call('toggleMinicardLabelText');
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('hiddenMinicardLabelText')) {
cookies.remove('hiddenMinicardLabelText');
} else {
@@ -136,8 +136,6 @@ Template.homeSidebar.helpers({
if (currentUser) {
return (currentUser.profile || {}).hiddenMinicardLabelText;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('hiddenMinicardLabelText')) {
return true;
} else {
diff --git a/client/components/swimlanes/swimlaneHeader.js b/client/components/swimlanes/swimlaneHeader.js
index 69971b05..fbc45351 100644
--- a/client/components/swimlanes/swimlaneHeader.js
+++ b/client/components/swimlanes/swimlaneHeader.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
const { calculateIndexData } = Utils;
let swimlaneColors;
@@ -34,8 +36,6 @@ Template.swimlaneHeader.helpers({
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
return true;
} else {
diff --git a/client/components/swimlanes/swimlanes.jade b/client/components/swimlanes/swimlanes.jade
index b2e03afe..1dc23c59 100644
--- a/client/components/swimlanes/swimlanes.jade
+++ b/client/components/swimlanes/swimlanes.jade
@@ -20,28 +20,6 @@ template(name="swimlane")
if currentUser.isBoardMember
unless currentUser.isCommentOnly
+addListForm
- //if collapseSwimlane
- // // Minimize swimlanes next 2 lines below https://www.w3schools.com/howto/howto_js_accordion.asp
- // button(class="accordion")
- // div(class="panel")
- // .swimlane.js-lists.js-swimlane
- // if isMiniScreen
- // if currentListIsInThisSwimlane _id
- // +list(currentList)
- // unless currentList
- // each lists
- // +miniList(this)
- // if currentUser.isBoardMember
- // unless currentUser.isCommentOnly
- // +addListForm
- // else
- // each lists
- // +list(this)
- // if currentCardIsInThisList _id ../_id
- // +cardDetails(currentCard)
- // if currentUser.isBoardMember
- // unless currentUser.isCommentOnly
- // +addListForm
template(name="listsGroup")
.swimlane.list-group.js-lists
diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js
index 9bc093be..d072a2a2 100644
--- a/client/components/swimlanes/swimlanes.js
+++ b/client/components/swimlanes/swimlanes.js
@@ -1,10 +1,12 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
const { calculateIndex, enableClickOnTouch } = Utils;
function currentListIsInThisSwimlane(swimlaneId) {
const currentList = Lists.findOne(Session.get('currentList'));
return (
- currentList
- && (currentList.swimlaneId === swimlaneId || currentList.swimlaneId === '')
+ currentList &&
+ (currentList.swimlaneId === swimlaneId || currentList.swimlaneId === '')
);
}
@@ -12,14 +14,14 @@ function currentCardIsInThisList(listId, swimlaneId) {
const currentCard = Cards.findOne(Session.get('currentCard'));
const currentUser = Meteor.user();
if (
- currentUser
- && currentUser.profile
- && Utils.boardView() === 'board-view-swimlanes'
+ currentUser &&
+ currentUser.profile &&
+ Utils.boardView() === 'board-view-swimlanes'
)
return (
- currentCard
- && currentCard.listId === listId
- && currentCard.swimlaneId === swimlaneId
+ currentCard &&
+ currentCard.listId === listId &&
+ currentCard.swimlaneId === swimlaneId
);
// Default view: board-view-lists
else return currentCard && currentCard.listId === listId;
@@ -90,9 +92,9 @@ function initSortable(boardComponent, $listsDom) {
function userIsMember() {
return (
- Meteor.user()
- && Meteor.user().isBoardMember()
- && !Meteor.user().isCommentOnly()
+ Meteor.user() &&
+ Meteor.user().isBoardMember() &&
+ !Meteor.user().isCommentOnly()
);
}
@@ -103,8 +105,6 @@ function initSortable(boardComponent, $listsDom) {
showDesktopDragHandles = (currentUser.profile || {})
.showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
showDesktopDragHandles = true;
} else {
@@ -146,26 +146,6 @@ BlazeComponent.extendComponent({
}
initSortable(boardComponent, $listsDom);
-
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
- if (cookies.has('collapseSwimlane')) {
- // Minimize swimlanes start https://www.w3schools.com/howto/howto_js_accordion.asp
- const acc = document.getElementsByClassName('accordion');
- let i;
- for (i = 0; i < acc.length; i++) {
- acc[i].addEventListener('click', function() {
- this.classList.toggle('active');
- const panel = this.nextElementSibling;
- if (panel.style.maxHeight) {
- panel.style.maxHeight = null;
- } else {
- panel.style.maxHeight = `${panel.scrollHeight}px`;
- }
- });
- }
- // Minimize swimlanes end https://www.w3schools.com/howto/howto_js_accordion.asp
- }
},
onCreated() {
this.draggingActive = new ReactiveVar(false);
@@ -203,8 +183,6 @@ BlazeComponent.extendComponent({
showDesktopDragHandles = (currentUser.profile || {})
.showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
showDesktopDragHandles = true;
} else {
@@ -213,15 +191,15 @@ BlazeComponent.extendComponent({
}
const noDragInside = ['a', 'input', 'textarea', 'p'].concat(
- Utils.isMiniScreen()
- || (!Utils.isMiniScreen() && showDesktopDragHandles)
+ Utils.isMiniScreen() ||
+ (!Utils.isMiniScreen() && showDesktopDragHandles)
? ['.js-list-handle', '.js-swimlane-header-handle']
: ['.js-list-header'],
);
if (
- $(evt.target).closest(noDragInside.join(',')).length === 0
- && this.$('.swimlane').prop('clientHeight') > evt.offsetY
+ $(evt.target).closest(noDragInside.join(',')).length === 0 &&
+ this.$('.swimlane').prop('clientHeight') > evt.offsetY
) {
this._isDragging = true;
this._lastDragPositionX = evt.clientX;
@@ -255,8 +233,8 @@ BlazeComponent.extendComponent({
onCreated() {
this.currentBoard = Boards.findOne(Session.get('currentBoard'));
this.isListTemplatesSwimlane =
- this.currentBoard.isTemplatesBoard()
- && this.currentData().isListTemplatesSwimlane();
+ this.currentBoard.isTemplatesBoard() &&
+ this.currentData().isListTemplatesSwimlane();
this.currentSwimlane = this.currentData();
},
@@ -299,8 +277,6 @@ Template.swimlane.helpers({
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
return true;
} else {
@@ -310,9 +286,9 @@ Template.swimlane.helpers({
},
canSeeAddList() {
return (
- Meteor.user()
- && Meteor.user().isBoardMember()
- && !Meteor.user().isCommentOnly()
+ Meteor.user() &&
+ Meteor.user().isBoardMember() &&
+ !Meteor.user().isCommentOnly()
);
},
});
diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js
index 1f0e3ef0..5f36ef54 100644
--- a/client/components/users/userHeader.js
+++ b/client/components/users/userHeader.js
@@ -1,3 +1,6 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
+
Template.headerUserBar.events({
'click .js-open-header-member-menu': Popup.open('memberMenu'),
'click .js-change-avatar': Popup.open('changeAvatar'),
@@ -177,28 +180,20 @@ Template.changeSettingsPopup.helpers({
currentUser = Meteor.user();
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
+ } else if (cookies.has('showDesktopDragHandles')) {
+ return true;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
- if (cookies.has('showDesktopDragHandles')) {
- return true;
- } else {
- return false;
- }
+ return false;
}
},
hiddenSystemMessages() {
currentUser = Meteor.user();
if (currentUser) {
return (currentUser.profile || {}).hasHiddenSystemMessages;
+ } else if (cookies.has('hasHiddenSystemMessages')) {
+ return true;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
- if (cookies.has('hasHiddenSystemMessages')) {
- return true;
- } else {
- return false;
- }
+ return false;
}
},
showCardsCountAt() {
@@ -206,8 +201,6 @@ Template.changeSettingsPopup.helpers({
if (currentUser) {
return Meteor.user().getLimitToShowCardsCount();
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
return cookies.get('limitToShowCardsCount');
}
},
@@ -218,28 +211,20 @@ Template.changeSettingsPopup.events({
currentUser = Meteor.user();
if (currentUser) {
Meteor.call('toggleDesktopDragHandles');
+ } else if (cookies.has('showDesktopDragHandles')) {
+ cookies.remove('showDesktopDragHandles');
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
- if (cookies.has('showDesktopDragHandles')) {
- cookies.remove('showDesktopDragHandles');
- } else {
- cookies.set('showDesktopDragHandles', 'true');
- }
+ cookies.set('showDesktopDragHandles', 'true');
}
},
'click .js-toggle-system-messages'() {
currentUser = Meteor.user();
if (currentUser) {
Meteor.call('toggleSystemMessages');
+ } else if (cookies.has('hasHiddenSystemMessages')) {
+ cookies.remove('hasHiddenSystemMessages');
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
- if (cookies.has('hasHiddenSystemMessages')) {
- cookies.remove('hasHiddenSystemMessages');
- } else {
- cookies.set('hasHiddenSystemMessages', 'true');
- }
+ cookies.set('hasHiddenSystemMessages', 'true');
}
},
'click .js-apply-show-cards-at'(event, templateInstance) {
@@ -253,8 +238,6 @@ Template.changeSettingsPopup.events({
if (currentUser) {
Meteor.call('changeLimitToShowCardsCount', minLimit);
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
cookies.set('limitToShowCardsCount', minLimit);
}
Popup.back();
diff --git a/client/lib/utils.js b/client/lib/utils.js
index c90dd749..f4fc170a 100644
--- a/client/lib/utils.js
+++ b/client/lib/utils.js
@@ -1,7 +1,8 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
+
Utils = {
setBoardView(view) {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
currentUser = Meteor.user();
if (currentUser) {
Meteor.user().setBoardView(view);
@@ -9,17 +10,12 @@ Utils = {
cookies.set('boardView', 'board-view-lists'); //true
} else if (view === 'board-view-swimlanes') {
cookies.set('boardView', 'board-view-swimlanes'); //true
- //} else if (view === 'board-view-collapse') {
- // cookies.set('boardView', 'board-view-swimlane'); //true
- // cookies.set('collapseSwimlane', 'true'); //true
} else if (view === 'board-view-cal') {
cookies.set('boardView', 'board-view-cal'); //true
}
},
unsetBoardView() {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
cookies.remove('boardView');
cookies.remove('collapseSwimlane');
},
@@ -29,17 +25,12 @@ Utils = {
if (currentUser) {
return (currentUser.profile || {}).boardView;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.get('boardView') === 'board-view-lists') {
return 'board-view-lists';
} else if (
cookies.get('boardView') === 'board-view-swimlanes'
- //&& !cookies.has('collapseSwimlane')
) {
return 'board-view-swimlanes';
- //} else if (cookies.has('collapseSwimlane')) {
- // return 'board-view-swimlanes';
} else if (cookies.get('boardView') === 'board-view-cal') {
return 'board-view-cal';
} else {