summaryrefslogtreecommitdiffstats
path: root/client/components/swimlanes
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/swimlanes')
-rw-r--r--client/components/swimlanes/swimlaneHeader.js8
-rw-r--r--client/components/swimlanes/swimlanes.jade26
-rw-r--r--client/components/swimlanes/swimlanes.js55
3 files changed, 63 insertions, 26 deletions
diff --git a/client/components/swimlanes/swimlaneHeader.js b/client/components/swimlanes/swimlaneHeader.js
index 6f8029fd..c8ef4dcb 100644
--- a/client/components/swimlanes/swimlaneHeader.js
+++ b/client/components/swimlanes/swimlaneHeader.js
@@ -30,7 +30,13 @@ BlazeComponent.extendComponent({
Template.swimlaneHeader.helpers({
showDesktopDragHandles() {
- return Meteor.user().hasShowDesktopDragHandles();
+ import { Cookies } from 'meteor/ostrio:cookies';
+ const cookies = new Cookies();
+ if (cookies.has('showDesktopDragHandles')) {
+ return true;
+ } else {
+ return false;
+ }
},
});
diff --git a/client/components/swimlanes/swimlanes.jade b/client/components/swimlanes/swimlanes.jade
index 3c70833e..ea9cc913 100644
--- a/client/components/swimlanes/swimlanes.jade
+++ b/client/components/swimlanes/swimlanes.jade
@@ -1,9 +1,7 @@
template(name="swimlane")
.swimlane
+swimlaneHeader
- // Minimize swimlanes next 2 lines below https://www.w3schools.com/howto/howto_js_accordion.asp
- button(class="accordion")
- div(class="panel")
+ unless collapseSwimlane
.swimlane.js-lists.js-swimlane
if isMiniScreen
if currentListIsInThisSwimlane _id
@@ -22,6 +20,28 @@ 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 56d8fb81..1bb522e5 100644
--- a/client/components/swimlanes/swimlanes.js
+++ b/client/components/swimlanes/swimlanes.js
@@ -14,7 +14,7 @@ function currentCardIsInThisList(listId, swimlaneId) {
if (
currentUser &&
currentUser.profile &&
- currentUser.profile.boardView === 'board-view-swimlanes'
+ Utils.boardView() === 'board-view-swimlanes'
)
return (
currentCard &&
@@ -97,10 +97,9 @@ function initSortable(boardComponent, $listsDom) {
}
boardComponent.autorun(() => {
- if (
- Utils.isMiniScreen() ||
- (!Utils.isMiniScreen() && Meteor.user().hasShowDesktopDragHandles())
- ) {
+ import { Cookies } from 'meteor/ostrio:cookies';
+ const cookies = new Cookies();
+ if (!Utils.isMiniScreen() && cookies.has('showDesktopDragHandles')) {
$listsDom.sortable({
handle: '.js-list-handle',
});
@@ -135,21 +134,25 @@ BlazeComponent.extendComponent({
initSortable(boardComponent, $listsDom);
- // 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`;
- }
- });
+ 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
}
- // Minimize swimlanes end https://www.w3schools.com/howto/howto_js_accordion.asp
},
onCreated() {
this.draggingActive = new ReactiveVar(false);
@@ -181,10 +184,12 @@ BlazeComponent.extendComponent({
// the user will legitimately expect to be able to select some text with
// his mouse.
+ import { Cookies } from 'meteor/ostrio:cookies';
+ const cookies = new Cookies();
+
const noDragInside = ['a', 'input', 'textarea', 'p'].concat(
Utils.isMiniScreen() ||
- (!Utils.isMiniScreen() &&
- Meteor.user().hasShowDesktopDragHandles())
+ (!Utils.isMiniScreen() && cookies.has('showDesktopDragHandles'))
? ['.js-list-handle', '.js-swimlane-header-handle']
: ['.js-list-header'],
);
@@ -265,7 +270,13 @@ BlazeComponent.extendComponent({
Template.swimlane.helpers({
showDesktopDragHandles() {
- return Meteor.user().hasShowDesktopDragHandles();
+ import { Cookies } from 'meteor/ostrio:cookies';
+ const cookies = new Cookies();
+ if (cookies.has('showDesktopDragHandles')) {
+ return true;
+ } else {
+ return false;
+ }
},
canSeeAddList() {
return (